Python 如何卸载 jupyter

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33052232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 12:40:53  来源:igfitidea点击:

How to uninstall jupyter

pythonjupyter

提问by jigar surana

I have been trying to uninstall jupyter

我一直在尝试卸载 jupyter

I have tried the following commands

我尝试了以下命令

pip uninstall jupyter
pip3 uninstall jupyter

and

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

Even after running all these commands when I type jupyter in the terminal I get the following message

即使在终端中输入 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

What exactly is going wrong and why am I still able to use the command?

到底出了什么问题,为什么我仍然可以使用该命令?

回答by Stan_MD

When you $ pip install jupyterseveral dependencies are installed. The best way to uninstall it completely is by running:

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

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

Kindly refer to this related question.

请参考这个相关问题

pip-autoremoveremoves a package and its unused dependencies. Here are the docs.

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

回答by NoahCao

If you installed Jupiter notebook through anaconda, this may help you:

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

conda uninstall jupyter notebook

回答by Ankit S

Try pip uninstall jupyter_core. Details below:

试试pip uninstall jupyter_core。详情如下:

I ran into a similar issue when my jupyter notebook only showed Python 2 notebook. (no Python 3 notebook)

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

I tried to uninstall jupyter by pip unistall jupyter, pi3 uninstall jupyter, and the suggested pip-autoremove jupyter -y.

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

Nothing worked. I ran which jupyter, and got /home/ankit/.local/bin/jupyter

没有任何效果。我跑了which jupyter,得到/home/ankit/.local/bin/jupyter

The file /home/ankit/.local/bin/jupyterwas just a simple python code:

该文件/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())

Tried to uninstall the module jupyter_coreby pip uninstall jupyter_coreand it worked.

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

Reinstalled jupyter with pip3 install jupyterand everything was back to normal.

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

回答by Hossain Mahmood Tuhin

For python 3.7:

对于python 3.7:

  1. On windows command prompt, type: "py -m pip install pip-autoremove". You will get a successful message.
  2. Change directory, if you didn't add the following as your PATH: cd C:\Users{user_name}\AppData\Local\Programs\Python\Python37-32\Scripts To know where your package/application has been installed/located, type: "where program_name" like> where jupyter If you didn't find a location, you need to add the location in PATH.

  3. Type: pip-autoremove jupyter It will ask to type y/n to confirm the action.

  1. 在 Windows 命令提示符下,键入:“py -m pip install pip-autoremove”。您将收到一条成功消息。
  2. 更改目录,如果您没有将以下内容添加为 PATH: cd C:\Users{user_name}\AppData\Local\Programs\Python\Python37-32\Scripts 要了解您的包/应用程序的安装/定位位置, type: "where program_name" like> where jupyter 如果没有找到位置,需要在PATH中添加位置。

  3. 输入:pip-autoremove jupyter 它将要求输入 y/n 以确认操作。

回答by Dharma

If you are using jupyter notebook, You can remove it like this:

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

pip uninstall notebook

You should use conda uninstall if you installed it with conda.

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

回答by Rahul Bharadwaj

If you don't want to use pip-autoremove(since it removes dependencies shared among other packages) and pip3 uninstall jupyterjust removed some packages, then do the following:

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

Copy-Paste:

复制粘贴:

sudomay be needed as per your need.

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

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

Note:

笔记:

The above command will only uninstall jupyterspecific packages. I have not added other packages to uninstall since they might be shared among other packages (eg: Jinja2is used by Flask, ipythonis a separate set of packages themselves, tornadoagain might be used by others).

上面的命令只会卸载jupyter特定的包。我没有添加其他要卸载的包,因为它们可能在其他包之间共享(例如:Jinja2被 使用Flaskipython本身是一组单独的包,tornado也可能被其他人使用)。

In any case, all the dependencies are mentioned below(as of 17 Nov, 2019. jupyter==4.4.0)

无论如何,下面提到了所有依赖项(截至 2019 年 11 月 17 日。jupyter==4.4.0

If you are sure you want to remove all the dependencies, then you can use Stan_MD's answer.

如果您确定要删除所有依赖项,则可以使用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

Executive Edit:

执行编辑:

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

Explanation of each:

各说明:

  1. Uninstall jupyterdist-packages:

    pip3 uninstall jupyter

  2. Uninstall jupyter_coredist-packages (It also uninstalls following binaries: jupyter, jupyter-migrate,jupyter-troubleshoot):

    pip3 uninstall jupyter_core

  3. Uninstall jupyter-client:

    pip3 uninstall jupyter-client

  4. Uninstall jupyter-console:

    pip3 uninstall jupyter-console

  5. Uninstall jupyter-notebook(It also uninstalls following binaries: jupyter-bundlerextension, jupyter-nbextension, jupyter-notebook, jupyter-serverextension):

    pip3 uninstall notebook

  6. Uninstall jupyter-qtconsole:

    pip3 uninstall qtconsole

  7. Uninstall jupyter-nbconvert:

    pip3 uninstall nbconvert

  8. Uninstall jupyter-trust:

    pip3 uninstall nbformat

  1. 卸载jupyterdist 包:

    pip3 uninstall jupyter

  2. 卸载jupyter_coredist-packages(它还卸载以下二进制文件:jupyter, jupyter-migrate, jupyter-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

回答by J11

In pip3

在 pip3

pip3 uninstall jupyterlab

pip3 卸载 jupyterlab

回答by Ankit Kumar Rajpoot

In my case, I have installed it via pip3 on mac.

就我而言,我已在 mac 上通过 pip3 安装了它。

pip3 uninstall notebook