【问题标题】:Cant remove jupyter related packages无法删除 jupyter 相关包
【发布时间】:2017-10-29 15:01:59
【问题描述】:

我要删除以下软件包 (2xTab):

$ jupyter-
jupyter-bundlerextension  jupyter-nbconvert         jupyter-nbextension       jupyter-notebook          jupyter-qtconsole         jupyter-serverextension   jupyter-trust 

而 pip 说他们不在那里:

$ pip3 freeze | grep jupyter
$ pip freeze | grep jupyter

当试图删除它们中的任何一个时,我得到了相同的结果,例如:

sudo -H pip3 uninstall jupyter-notebook
Cannot uninstall requirement jupyter-notebook, not installed

但例如:

$ which jupyter-notebook 
/usr/local/bin/jupyter-notebook

那么如何删除这些包?

【问题讨论】:

标签: python pip jupyter


【解决方案1】:

运行以下命令

pip3 show jupyter

它会给出一些输出,比如

Name: jupyter
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.org
License: BSD
Location: /usr/local/lib/python3.5/dist-packages
Requires: ipykernel, ipywidgets, qtconsole, jupyter-console, notebook, nbconvert

现在将输出中 Require 的值复制到剪贴板上,这是 jupyter 所需的包

然后运行以下命令

sudo pip3 uninstall -y jupyter [paste the copied content ]

相当于

sudo pip3 uninstall -y jupyter ipykernel ipywidgets qtconsole jupyter-console notebook nbconvert

确保在粘贴内容后删除包名称之间的逗号

【讨论】:

  • pip3 show jupyter 显示无输出。我已经删除了包jupyter-client==5.1.0 jupyter-console==5.2.0 jupyter-core==4.3.0
【解决方案2】:

您说必须删除的“包”实际上是脚本,其中大部分(全部?)由名为notebook 的 pip 包提供。通常,notebook 包作为名为@9​​87654323@ 的元包的依赖项安装(如另一个答案中所建议),但也可以在没有它的情况下安装。我建议您尝试(按照您已经列出的 sudo 等)

sudo -H pip3 uninstall notebook

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-29
    • 1970-01-01
    • 2017-07-11
    • 1970-01-01
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    相关资源
    最近更新 更多