“pip uninstall jupyter”不起作用,但是“which jupyter”返回有效路径[重复]

2024-03-06

我正在尝试卸载 jupyter。

pip uninstall jupyter,它给了我这个错误:

Cannot uninstall requirement jupyter, not installed

but which jupyter says

/usr/local/bin/jupyter

我尝试使用pip install pip-autoremove进而pip-autoremove jupyter -y但这给出了这个错误:

Traceback (most recent call last):
  File "/usr/local/bin/pip-autoremove", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/pip_autoremove.py", line 109, in main
    autoremove(args, yes=opts.yes)
  File "/Library/Python/2.7/site-packages/pip_autoremove.py", line 21, in autoremove
    dead = list_dead(names)
  File "/Library/Python/2.7/site-packages/pip_autoremove.py", line 28, in list_dead
    start = set(map(get_distribution, names))
  File "/Users/<username>/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 562, in get_distribution
    dist = get_provider(dist)
  File "/Users/<username>/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 436, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/Users/<username>/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 981, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/<username>/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 867, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyter' distribution was not found and is required by the application

Edit

更新问题以包括输出pip list

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
jupyter-client (5.1.0)
jupyter-console (5.2.0)
jupyter-core (4.3.0)

您的问题似乎已经得到解答here https://stackoverflow.com/a/52912244/7395911。看看它是否解决了您的问题,或者也许澄清了其中的差异。

与此同时,请查看下面我可以为您提供的提示。


利用虚拟环境 https://pypi.python.org/pypi/virtualenv如果可能的话,它将使您免于将来遇到类似的麻烦。

Run pip install virtualenv.

然后在您的项目文件夹或任何所需的文件夹中调用virtualenv venv.

我将创建一个虚拟环境您将没有安装任何软件包,或者可能只安装几个软件包。

要使用新创建的虚拟环境只需执行source venv/bin/activate.

Now run pip freeze它会向您显示一个干净的包裹列表。

安装你所有的要求像往常一样,我假设你知道怎么做。

然后运行你的jupyter项目。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

“pip uninstall jupyter”不起作用,但是“which jupyter”返回有效路径[重复] 的相关文章

随机推荐