如何卸载jupyter

jig*_*ana 46 python jupyter

我一直在尝试卸载jupyter

我尝试了以下命令

pip uninstall jupyter
pip3 uninstall jupyter
Run Code Online (Sandbox Code Playgroud)

rm -rf /Users/$user/Library/Jupyter/*
Run Code Online (Sandbox Code Playgroud)

即使在终端输入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
Run Code Online (Sandbox Code Playgroud)

究竟出了什么问题,为什么我仍然可以使用命令?

小智 60

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

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

请参考这个相关问题.

pip-autoremove删除包及其未使用的依赖项.这是文档.

  • 如果你想在2021年卸载它,只需将jupyter替换为notebook即可。 (4认同)
  • 最后,我找到了删除所有依赖项的解决方案。它完全有效。 (2认同)

Rah*_*waj 36

如果pip-autoremove方法没有删除所有内容并且pip3 uninstall jupyter只是删除了一些包,那么请执行以下操作:

复制粘贴:

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

python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console notebook qtconsole nbconvert nbformat
Run Code Online (Sandbox Code Playgroud)

-

执行编辑:

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
Run Code Online (Sandbox Code Playgroud)

每个解释:

  1. 卸载jupyterdist-packages:

    Jinja2

  2. 卸载Flask的dist-包(它也卸载以下二进制文件:ipython,tornado,jupyter==4.4.0):

    jupyter

  3. 卸载pip3 uninstall jupyter:

    jupyter_core

  4. 卸载jupyter:

    jupyter-migrate

  5. 卸载jupyter-troubleshoot(这也卸载以下二进制文件:pip3 uninstall jupyter_core,jupyter-client,pip3 uninstall jupyter-client,jupyter-console):

    pip3 uninstall jupyter-console

  6. 卸载jupyter-notebook:

    jupyter-bundlerextension

  7. 卸载jupyter-nbextension:

    jupyter-notebook

  8. 卸载jupyter-serverextension:

    pip3 uninstall notebook


小智 12

如果您通过 anaconda 安装 Jupiter notebook,这可能会帮助您:

conda uninstall jupyter notebook
Run Code Online (Sandbox Code Playgroud)

  • 这将更好地作为评论。尽管他们正在使用 pip - anaconda 仍然是一个假设。 (2认同)

小智 9

试试pip uninstall jupyter_core.详情如下:

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

我试图卸载jupyter pip unistall jupyter,pi3 uninstall jupyter和建议pip-autoremove jupyter -y.

没有任何效果.我跑了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())
Run Code Online (Sandbox Code Playgroud)

试图卸载该模块jupyter_core通过pip uninstall jupyter_core和它的工作.

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


Dha*_*rma 7

如果您使用的是 jupyter notebook,您可以像这样删除它:

pip uninstall notebook
Run Code Online (Sandbox Code Playgroud)

如果使用 conda 安装,则应使用 conda uninstall。