【发布时间】:2017-01-30 11:46:31
【问题描述】:
我在我的Mac OSX 上安装了jupyter 和python3.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/中的文件和子文件夹,但这似乎不必要地残忍?
【问题讨论】:
-
试试
sudo -H python3 -m pip uninstall jupyter。 -
结果是:
20:39 $ sudo -H python3 -m pip uninstall jupyter Password: Cannot uninstall requirement jupyter, not installed 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. -
@edwinksl,它并没有解决看起来的问题。不过谢谢。
-
还有其他建议吗?
-
也许不用
sudo试试?
标签: python ipython jupyter jupyter-notebook