LoginSignup
4
1

More than 1 year has passed since last update.

突然Jupyterが使えなくなったので解決方法メモ

Last updated at Posted at 2022-03-06

背景

今まで普通に作業できていたのだが、VSCodeでJupyterが使えなくなった。

環境

M1 MacBook Air
python3.8.9(homebrewでインストール)

やったこと

手始めに、pip uninstall jupyterでアンストしてからpip install jupyterとした。これで一応インストールはできたのだがjupyterコマンド(jupyter notebookなど)が使えなかった。

調べてみるとjupyterコマンドのパスが通っていないからという記事を見つけるも、そもそもjupyterコマンドが入っていないようでパスの通しようがなかった。

結論

sudo -H pip3 install jupyterとしたらjupyter notebookもVSCodeでのjupyterも使えるようになったのだが理由は不明(ちなみにこちらではパスワードを要求された。)、わかり次第追記します。

試行錯誤の中で使ったコマンド

  • brew list
    homebrewにインストールしているもののリストを表示

  • echo $PATH
    パス一覧を表示

  • which jupyter
    jupyterコマンドのパスを表示

  • printenv
    環境変数一覧を表示

  • pip show jupyter
    jupyterのPATHなどを表示

  • brew uninstall jupyterbrew install jupyter
    brew install jupyterでは他の様々なパッケージも大量にインストールされる

  • jupyter kernelspec list
    jupyterのカーネル一覧が表示される

  • jupyter kernelspec uninstall hogehoge
    listで表示されたものをhogehogeに入れるとアンインストールできる

  • brew doctor
    brewの指摘をしてくれる

  • brew cleanup
    brew内の掃除??

その他

  • pip uninstall ipykernel
  • pip install ipykernel
  • sudo pip uninstall virtualenvwrapper
  • sudo pip uninstall virtualenv
  • brew uninstall pyenv-virtualenv
  • brew uninstall pyenv

sudo -H pip3 install jupyterで解決した理由を、ご存知の方いらっしゃいましたらコメントお願いいたします。
僕自身あやふやなのでご指摘も大歓迎です。

参考

解決につながった記事
https://degitalization.hatenablog.jp/entry/2020/12/07/154628

4
1
1

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
4
1