首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用pip卸载jupyter

用pip卸载jupyter
EN

Ask Ubuntu用户
提问于 2018-05-27 11:50:36
回答 1查看 21.3K关注 0票数 0

我在这里有jupyter可执行文件:/usr/local/bin/jupyter

我知道历史上我一直在使用Ubuntu发行版的Python2(没有Anaconda),所以我认为jupyter来自一个系统pip2安装,但是我找不到一个方法来证明这一点,有吗?

假设前面的场景,我同时完成了以下操作:sudo /usr/local/bin/pip2 uninstall jupytersudo /usr/local/bin/pip2 uninstall notebook (即使在/usr/local/bin中,我仍然需要sudo,因为由于某种原因,这里的所有文件似乎都属于root ),但是我一直在这里看到这个可执行文件:/usr/local/bin/jupyter

另外:我知道jupyter是受影响的,因为现在命令:jupyter notebook给出了输出Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

我如何卸载它?为什么pip2不删除该可执行文件?

编辑:

我目前在我的文件系统上看到了这样的内容:

代码语言:javascript
复制
ls -lah /usr/local/bin | grep jupyter
-rwxr-xr-x  1 root root  222 May  6  2017 jupyter
-rwxr-xr-x  1 root root  221 May  6  2017 jupyter-console
-rwxr-xr-x  1 root root  264 May  6  2017 jupyter-kernelspec
-rwxr-xr-x  1 root root  222 May  6  2017 jupyter-migrate
-rwxr-xr-x  1 root root  224 May  6  2017 jupyter-nbconvert
-rwxr-xr-x  1 root root  224 May  6  2017 jupyter-qtconsole
-rwxr-xr-x  1 root root  243 May  6  2017 jupyter-run
-rwxr-xr-x  1 root root  227 May  6  2017 jupyter-troubleshoot
-rwxr-xr-x  1 root root  255 May  6  2017 jupyter-trust

jupyter处于不稳定状态时,我看到了这样的情况:

代码语言:javascript
复制
sudo pip2 uninstall jupyter
[sudo] password for <MY_USERNAME>: 
The directory '/home/<MY_USERNAME>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling jupyter-1.0.0:
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/DESCRIPTION.rst
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/INSTALLER
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/METADATA
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/RECORD
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/WHEEL
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/metadata.json
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/pbr.json
  /usr/local/lib/python2.7/dist-packages/jupyter-1.0.0.dist-info/top_level.txt
  /usr/local/lib/python2.7/dist-packages/jupyter.py
  /usr/local/lib/python2.7/dist-packages/jupyter.pyc
Proceed (y/n)? y
  Successfully uninstalled jupyter-1.0.0
The directory '/home/<MY_USERNAME>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

notebook处于不稳定状态时,我看到了这样的情况:

代码语言:javascript
复制
sudo pip2 uninstall notebook
The directory '/home/<MY_USERNAME>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling notebook-5.0.0:
  /usr/local/bin/jupyter-bundlerextension
  /usr/local/bin/jupyter-nbextension
  /usr/local/bin/jupyter-notebook
  /usr/local/bin/jupyter-serverextension
  /usr/local/lib/python2.7/dist-packages/notebook-5.0.0.dist-info/DESCRIPTION.rst

  [...]

  /usr/local/lib/python2.7/dist-packages/notebook/tree/tests/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/notebook/tree/tests/test_tree_handler.py
  /usr/local/lib/python2.7/dist-packages/notebook/tree/tests/test_tree_handler.pyc
  /usr/local/lib/python2.7/dist-packages/notebook/utils.py
  /usr/local/lib/python2.7/dist-packages/notebook/utils.pyc
  /usr/local/lib/python2.7/dist-packages/notebook/view/__init__.py
  /usr/local/lib/python2.7/dist-packages/notebook/view/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/notebook/view/handlers.py
  /usr/local/lib/python2.7/dist-packages/notebook/view/handlers.pyc
Proceed (y/n)? y
  Successfully uninstalled notebook-5.0.0
The directory '/home/<MY_USERNAME>/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
EN

回答 1

Ask Ubuntu用户

发布于 2018-08-25 11:44:26

我已经使用下面的代码行卸载了jupyter,所以尝试一下。

代码语言:javascript
复制
$ sudo -H python3 -m pip uninstall jupyter_core jupyter_qtconsole nbformat nbconvert notebook

Uninstalling jupyter-core-4.4.0:
      Would remove:
        /usr/bin/jupyter
        /usr/bin/jupyter-migrate
        /usr/bin/jupyter-troubleshoot
        /usr/lib/python3/dist-packages/jupyter.py
        /usr/lib/python3/dist-packages/jupyter_core
        /usr/lib/python3/dist-packages/jupyter_core-4.4.0.egg-info
Uninstalling nbformat-4.4.0:
      Would remove:
        /home/varun/.local/bin/jupyter-trust
        /home/varun/.local/lib/python3.6/site-packages/nbformat-4.4.0.dist-info/*
        /home/varun/.local/lib/python3.6/site-packages/nbformat/*
    Proceed (y/n)? y
      Successfully uninstalled nbformat-4.4.0
Uninstalling nbconvert-5.3.1:
      Would remove:
        /home/varun/.local/bin/jupyter-nbconvert
        /home/varun/.local/lib/python3.6/site-packages/nbconvert-5.3.1.dist-info/*
        /home/varun/.local/lib/python3.6/site-packages/nbconvert/*
    Proceed (y/n)? y
        Successfully uninstalled nbconvert-5.3.1
 Uninstalling notebook-5.6.0:
      Would remove:
        /home/varun/.local/bin/jupyter-bundlerextension
        /home/varun/.local/bin/jupyter-nbextension
        /home/varun/.local/bin/jupyter-notebook
        /home/varun/.local/bin/jupyter-serverextension
        /home/varun/.local/lib/python3.6/site-packages/notebook-5.6.0.dist-info/*
        /home/varun/.local/lib/python3.6/site-packages/notebook/*
    Proceed (y/n)? y
      Successfully uninstalled notebook-5.6.0
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1040859

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档