【问题标题】:"pip uninstall jupyter" does not work but, "which jupyter" returns a valid path [duplicate]“pip uninstall jupyter”不起作用,但“which jupyter”返回有效路径[重复]
【发布时间】:2017-09-22 20:40:34
【问题描述】:

我正在尝试卸载 jupyter。

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

Cannot uninstall requirement jupyter, not installed

但是which jupyter

/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

编辑

更新问题以包含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)

【问题讨论】:

  • 你能查一下pip list吗?或pip list | grep jupyter 会返回任何结果。
  • 是 @bhansa 弃用:默认格式将在未来切换到列。您可以使用 --format=(legacy|columns) (或在 [list] 部分下的 pip.conf 中定义 format=(legacy|columns) )来禁用此警告。 jupyter-client (5.1.0) jupyter-console (5.2.0) jupyter-core (4.3.0)
  • 你可以试试pip uninstall jupyter-* 吗?
  • 您找到解决方案了吗?我面临同样的问题
  • 不.. 没用过

标签: python pip jupyter


【解决方案1】:

您的问题似乎已经回答了here。看看它是否能解决您的问题,或者澄清与它的不同之处。

与此同时,看看我可以在下面给你的提示。


如果可能的话,使用virtualenv,它会让你免于以后这样的头痛。

运行pip install virtualenv

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

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

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

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

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

然后运行您的 jupyter 项目。

【讨论】:

  • 问题是关于卸载 jupyter。
  • @GinoMempin 是的,我不记得为什么,但我认为这可以帮助解决问题。尽管如此,我会尽快编辑我的答案以匹配问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-11-17
  • 2017-06-02
  • 1970-01-01
  • 1970-01-01
  • 2022-01-14
  • 1970-01-01
  • 2020-05-23
相关资源
最近更新 更多