背景
今まで普通に作業できていたのだが、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 jupyter
とbrew 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