“pip uninstall jupyter”不起作用,但“which jupyter”返回有效路径

use*_*335 6 python pip jupyter

我正在尝试卸载 jupyter。

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

Cannot uninstall requirement jupyter, not installed
Run Code Online (Sandbox Code Playgroud)

which jupyter

/usr/local/bin/jupyter
Run Code Online (Sandbox Code Playgroud)

我尝试使用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
Run Code Online (Sandbox Code Playgroud)

编辑

更新问题以包括输出 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)
Run Code Online (Sandbox Code Playgroud)

Ber*_*rte 1

看来您的问题已经在这里得到了解答。看看它是否解决了您的问题,或者也许澄清了其中的差异。

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


如果可能的话,使用virtualenv,它将让你避免以后遇到这样的麻烦。

跑步pip install virtualenv

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

我将创建一个虚拟环境,您将在其中不安装任何软件包或只安装几个软件包。

要使用新创建的virtualenv只需执行source venv/bin/activate.

现在运行pip freeze,它将显示一个干净的包列表。

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

然后运行你的jupyter项目。

  • 问题是关于_卸载_jupyter。 (3认同)