点击卸载jupyter不起作用,但jupyter返回

时间:2017-09-22 20:40:34

标签: python pip jupyter

我正在尝试卸载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:&#39; jupyter&#39;未找到分发并且是应用程序要求

修改

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

1 个答案:

答案 0 :(得分:0)

如果可能的话,尽量使用virtualenv,这样可以避免将来出现这样的麻烦。

运行pip install virtualenv

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

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

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

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

按照与往常一样的方式安装所有要求,我假设您知道如何操作。

然后运行 jupyter 项目。

相关问题