"pip卸载jupyter"不起作用,但是“哪个jupyter"返回有效路径 [英] "pip uninstall jupyter" does not work but, "which jupyter" returns a valid path

查看:362
本文介绍了"pip卸载jupyter"不起作用,但是“哪个jupyter"返回有效路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试卸载jupyter.

I am trying to uninstall jupyter.

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

pip uninstall jupyter, it gives me this error:

Cannot uninstall requirement jupyter, not installed

但是which jupyter

/usr/local/bin/jupyter

我尝试先使用pip install pip-autoremove,然后使用pip-autoremove jupyter -y,但出现此错误:

I tried using pip install pip-autoremove and then pip-autoremove jupyter -y but that gave this error:

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)

推荐答案

在这里.看一看,看看它是否可以解决您的问题,或者弄清其中的不同之处.

It looks like your question have already been answered here. Have a look and see if it solves your question or perhaps clarify the diferences from it.

同时,请看下面我可以给您的提示.

In the meantime, have a look at a tip I can give you below.

如果可能的话,请使用 virtualenv ,它将使您免于以后出现此类麻烦.

Make use of virtualenv if possible, it will save you from future headaches like this.

运行pip install virtualenv.

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

Then in your project folder, or any desired folder call virtualenv venv.

我将创建一个虚拟环境,在该环境中,您将不会安装任何软件包,也可能只会安装几个软件包.

I will create a virtual environment where you will have no packages installed or maybe just a few.

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

To use the newly created virtualenv just execute source venv/bin/activate.

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

Now run pip freeze and it will show you a clean package list.

按照通常的方式安装所有要求,我假设您知道该怎么做.

Install all you requirements the same way as usual, I'll assume you know how to do it.

然后运行您的 jupyter 项目.

这篇关于"pip卸载jupyter"不起作用,但是“哪个jupyter"返回有效路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆