gpt4 book ai didi

python - 如何正确卸载python jupyter?

转载 作者:太空狗 更新时间:2023-10-29 18:34:02 24 4
gpt4 key购买 nike

我在 Mac OSX 上安装了 jupyterpython3.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/ 中的文件和子文件夹,但这似乎不必要地残酷?

最佳答案

这里的答案解决了我的问题:https://stackoverflow.com/a/42277762/8057434

我只是总结一下该怎么做。运行

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

在您的终端中。

如果您不使用 anaconda,则可以使用 pip uninstall 而不是 conda uninstall

关于python - 如何正确卸载python jupyter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39629879/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com