如何卸载jupy

2024-09-30 23:30:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在试着卸载jupyter

我试过以下命令

pip uninstall jupyter
pip3 uninstall jupyter

以及

rm -rf /Users/$user/Library/Jupyter/*

即使当我在终端中输入jupyter时运行了所有这些命令,我也会得到以下消息

usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
               [--paths] [--json]
               [subcommand]
jupyter: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required

到底出了什么问题,为什么我还能使用这个命令?


Tags: piprm命令configdataversiondirpip3
3条回答

当您$ pip install jupyter安装几个依赖项时。完全卸载它的最佳方法是运行:

  1. $ pip install pip-autoremove
  2. $ pip-autoremove jupyter -y

请参考相关的question

pip-autoremove删除包及其未使用的依赖项。这是docs

尝试pip uninstall jupyter_core。详情如下:

当我的jupyter笔记本只显示Python 2笔记本时,我遇到了类似的问题。(没有Python3笔记本)

我试图通过pip unistall jupyterpi3 uninstall jupyter和建议的pip-autoremove jupyter -y卸载jupyter。

什么都没用。我运行which jupyter,得到/home/ankit/.local/bin/jupyter

文件/home/ankit/.local/bin/jupyter只是一个简单的python代码:

#!/usr/bin/python3

# -*- coding: utf-8 -*-
import re
import sys

from jupyter_core.command import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

试图通过pip uninstall jupyter_core卸载模块jupyter_core,它成功了。

pip3 install jupyter重新安装jupyter,一切恢复正常。

如果不想使用pip-autoremove(因为它删除了其他包之间共享的依赖项),并且pip3 uninstall jupyter只删除了一些包,请执行以下操作:

复制粘贴:

根据您的需要,可能需要sudo

python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console notebook qtconsole nbconvert nbformat

注:

以上命令将只卸载特定于jupyter的包。我没有添加要卸载的其他包,因为它们可能在其他包之间共享(例如,Jinja2Flask使用,ipython是一组独立的包本身,tornado可能由其他包使用)。

在任何情况下,所有依赖项如下所述(截至2019年11月17日)。jupyter==4.4.0

如果确定要删除所有依赖项,则可以使用Stan_MD的答案。

attrs
backcall
bleach
decorator
defusedxml
entrypoints
importlib-metadata
ipykernel
ipython
ipython-genutils
ipywidgets
jedi
Jinja2
jsonschema
jupyter
jupyter-client
jupyter-console
jupyter-core
MarkupSafe
mistune
more-itertools
nbconvert
nbformat
notebook
pandocfilters
parso
pexpect
pickleshare
prometheus-client
prompt-toolkit
ptyprocess
Pygments
pyrsistent
python-dateutil
pyzmq
qtconsole
Send2Trash
six
terminado
testpath
tornado
traitlets
wcwidth
webencodings
widgetsnbextension
zipp

行政编辑:

pip3 uninstall jupyter
pip3 uninstall jupyter_core
pip3 uninstall jupyter-client
pip3 uninstall jupyter-console
pip3 uninstall notebook
pip3 uninstall qtconsole
pip3 uninstall nbconvert
pip3 uninstall nbformat

每种解释:

  1. 卸载jupyterdist包:

    pip3 uninstall jupyter

  2. 卸载jupyter_coredist packages(它还卸载以下二进制文件:jupyterjupyter-migratejupyter-troubleshoot):

    pip3 uninstall jupyter_core

  3. 卸载jupyter-client

    pip3 uninstall jupyter-client

  4. 卸载jupyter-console

    pip3 uninstall jupyter-console

  5. 卸载jupyter-notebook(它还卸载以下二进制文件:jupyter-bundlerextensionjupyter-nbextensionjupyter-notebookjupyter-serverextension):

    pip3 uninstall notebook

  6. 卸载jupyter-qtconsole

    pip3 uninstall qtconsole

  7. 卸载jupyter-nbconvert

    pip3 uninstall nbconvert

  8. 卸载jupyter-trust

    pip3 uninstall nbformat

相关问题 更多 >