web-dev-qa-db-ja.com

python jupyterを正しくアンインストールする方法は?

Mac OSXjupyterpython3.5とともにインストールしましたが、python2.7バージョンが必要です。したがって、基本的には3.5バージョンをアンインストールし、2.7バージョンを再インストールする必要があります。

しかし、何らかの理由で3.5バージョンをアンインストールできません。私はSudo python3 -m pip uninstall jupyterを試しました、そしてあなたは以下の結果を見ることができます:

✔  ~/current/directory  
20:08 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
✔  ~/current/directory  
20:08 $ Sudo python3 -m pip uninstall jupyter
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with Sudo, you may want Sudo's -H flag.
Cannot uninstall requirement jupyter, not installed
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with Sudo, you may want Sudo's -H flag.
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
✘-1  ~/current/directory  
20:09 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter

...上記のように、which jupyterコマンドは有効なパスを返しますが、それだけではありません。コマンドラインからjupyter notebookを起動することはできますが、ノートブックが開きます。

既存のバージョンのjupyterを正しく削除するにはどうすればよいですか?または、誰かがpython2カーネルを既​​存のjupyterに追加する方法を知っている場合も、それで問題ありません。それは可能ですか?

私が考えることができるのは、/Library/Frameworks/Python.framework/Versions/3.5/bin/内のファイルとサブフォルダーを手動で強制終了することだけですが、これは不必要に残忍に思えますか?

11
Sother

ここでの答えは私の問題を解決しました: https://stackoverflow.com/a/42277762/8057434

何をすべきかを要約します。走る

conda uninstall notebook nbconvert nbformat ipykernel ipywidgets qtconsole traitlets tornado jupyter_* ipython_genutils jinja2 -y

あなたのターミナルで。

アナコンダを使用していない場合は、pip uninstallの代わりにconda uninstallを使用できます。

4
BhushanDhamale

homeフォルダーから~/AnacondaProjectsを削除します。その後、Anaconda environment variableexportをbashプロファイル~/.bashrcから削除します。

3
TheTechGuy

Pipの代わりにpip3を使用する

pip3 uninstall jupyter 

正しいpipバージョンを使用している限り、python 2とpython 3の両方を同じコンピューターにインストールできます。

1
Simon Black

Jupyter-core、jupyter-console、jupyter-clientは個別にアンインストールする必要があります。それらをすべて削除した後、これらはjupyterという名前のパッケージが見つかりません。

0
veralin

Mac OSXにpython3.5でjupyterをインストールしていますが、python2.7バージョンが必要です。

Anacondaは、特定のプロジェクトに必要なpythonソフトウェアをインストールするのに最適な方法です。

  1. https://www.continuum.io/downloads#macos からダウンロード
  2. 言ったように、bash Anaconda2-4.3.1-MacOSX-x86_64.sh(あなたの場合は2.7バージョン)
  3. インストールされているディレクトリに移動し、source bin/activateと入力します

これにより、適切なレベルのライブラリなどを含むコマンドライン環境が作成されます。内部では、f.exを使用してさらにデータをインストールできます。 conda install numpy。バージョンを修正するには、conda install numpy=1.10を使用します。

0
serv-inc