LoginSignup
2
4

VSCodeでJupyter Notebook が動かない

Last updated at Posted at 2023-02-10

著者は普段 VSCode で Jupyter Notebook を使っているのですが,ある日突然使えなくなったので,その時の解決法を残しておきます.

エラー内容

Jupyter Notebook 上でプログラムを実行すると以下のようにエラーがはかれました.

出力が サイズ制限 を超えています。テキスト エディターで完全な出力データ を開く
カーネルを起動できませんでした。 

Jupyter server crashed. Unable to connect. 

Error code from Jupyter: 1

usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]

                  [--paths] [--json] [--debug]

                  [subcommand]



Jupyter: Interactive Computing



positional arguments:

  subcommand     the subcommand to launch



options:
...


Jupyter command `jupyter-notebook` not found. 

詳細については、Jupyter [ログ] (command:jupyter.viewOutput) を参照してください。

解決方法

どうやら Python の Jupyter ライブラリと Notebook ライブラリが一緒に存在していたのが悪さをしていたようです.というのも,jupyter ライブラリには notebook を実行するサブコマンドがあるのですが,Notebook ライブラリが存在するときにはそのサブコマンドが使えなくなります.VSCode は jupyter から Jupyter Notebook を起動しているので notebook サブコマンドが使えなくてエラーになるようです.

著者は以下のように notebook ライブラリを消した後に jupyter ライブラリを更新したら VScode 上で Jupyter Notebook を動かせるようになりました.

pip uninstall notebook && pip install jupyter -U

ただ、このリンクを参考に環境を作り直すのが一番時間のためだなという...

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4