【问题标题】:I can't uninstall Jupyter with solutions on the web我无法使用网络上的解决方案卸载 Jupyter
【发布时间】:2021-05-29 07:27:12
【问题描述】:

我有一个非常奇怪的 Jupyter 安装。当我启动一个笔记本时,Balena Etcher 会加载一个 USB 图像软件。当我在启动笔记本时给出的命令行上键入链接时,我无法加载 Python 3 运行时。怎么回事?

(ENV) jpp@X390:~/dev$ which jupyter
/home/jpp/.local/bin/jupyter
(ENV) jpp@X390:~/dev$ pip uninstall jupyter
WARNING: Skipping jupyter as it is not installed.
(ENV) jpp@X390:~/dev$ pip3 uninstall jupyter
WARNING: Skipping jupyter as it is not installed.
(ENV) jpp@X390:~/dev$ pip-autoremove jupyter -y
Traceback (most recent call last):
  File "/home/jpp/.local/bin/pip-autoremove", line 8, in <module>
    sys.exit(main())
  File "/home/jpp/.local/lib/python2.7/site-packages/pip_autoremove.py", line 106, in main
    autoremove(args, yes=opts.yes)
  File "/home/jpp/.local/lib/python2.7/site-packages/pip_autoremove.py", line 21, in autoremove
    dead = list_dead(names)
  File "/home/jpp/.local/lib/python2.7/site-packages/pip_autoremove.py", line 28, in list_dead
    start = set(map(get_distribution, names))
  File "/home/jpp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/home/jpp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/home/jpp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/jpp/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyter' distribution was not found and is required by the application
(ENV) jpp@X390:~/dev$ 

非常感谢。如果我不能正确安装,我将重新安装 Mint..

【问题讨论】:

  • which pipwhich pip3 的输出是什么?你现在在虚拟环境中吗?如果是这样,请提供有关如何创建虚拟环境以及如何安装 jupyter 的信息。您可能使用了pip install --user,因为它将包安装到~/.local/bin。当您同时使用虚拟 env 和 pip install --user 时,会出现冲突的情况,因为这不是他们应该使用的方式。
  • @gordon-bai 我认为你是对的。我不记得我是如何安装 jupyter 的。 jpp@X390:~$ which pip/home/jpp/.local/bin/pipjpp@X390:~$ which pip3/usr/bin/pip3
  • 在这种情况下,总是有解决方案,只需删除 ~/.local/bin 中的 jupyter 包,对虚拟环境进行排序,然后在干净的虚拟环境中安装 jupyter,而不使用 --user 选项。没有必要重新安装整个系统,因为不应该有其他目录被污染。
  • 我刚做了,非常感谢!

标签: pip jupyter-notebook jupyter


【解决方案1】:

如果安装包时带有--user选项,请删除~/.local/bin中的jupyter包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-21
    相关资源
    最近更新 更多