pip-autoremove是个好东西

1、简述

今天闲得蛋疼在cmd下使用pip install jupyter安装了jupyter notebook,想研究研究,可惜用了一会儿暂时觉得对我无用,所以想卸载了它,于是输入命令pip unstall jupyter,哪知查询后只是卸载了jupyter,其依赖关系库依然存在。
百度一番没有结果,然后使用google输入how to uninstall jupyter就发现了pip-autoremove这个卸载工具:how-to-uninstall-jupyter

  • 输入pip install pip-autoremove安装该工具
  • 输入pip-autoremove jupyter -y卸载jupyter

2、扩展

pip-aotuoremove 0.9.0介绍:

Remove a package and its unused dependencies 删除包及其未使用的依赖关系

用法:

Usage: pip-autoremove [OPTION]... [NAME]...

Options:
  --version     show program's version number and exit
  -h, --help    show this help message and exit
  -l, --list    list unused dependencies, but don't uninstall them.
  -L, --leaves  list leaves (packages which are not used by any others).
  -y, --yes     don't ask for confirmation of uninstall deletions.

用例:

Uninstall it and all its unused dependencies卸载它及其所有未使用的依赖关系:

$ pip-autoremove Flask -y

Flask 0.10.1 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Werkzeug 0.9.6 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Jinja2 2.7.3 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
        MarkupSafe 0.23 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    itsdangerous 0.24 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)

Uninstalling MarkupSafe:
  Successfully uninstalled MarkupSafe
Uninstalling Jinja2:
  Successfully uninstalled Jinja2
Uninstalling itsdangerous:
  Successfully uninstalled itsdangerous
Uninstalling Werkzeug:
  Successfully uninstalled Werkzeug
Uninstalling Flask:
  Successfully uninstalled Flask

Remove multiple packages and their dependencies at once一次删除多个包及其依赖关系:

$ pip install Flask Sphinx

...
Successfully installed Flask Sphinx Werkzeug Jinja2 itsdangerous Pygments docutils markupsafe
Cleaning up...
$ pip-autoremove Flask Sphinx -y

Sphinx 1.2.2 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Jinja2 2.7.3 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
        MarkupSafe 0.23 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Pygments 1.6 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    docutils 0.12 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
Flask 0.10.1 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Werkzeug 0.9.6 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    Jinja2 2.7.3 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
        MarkupSafe 0.23 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
    itsdangerous 0.24 (/tmp/pip-autoremove/.venv/lib/python2.7/site-packages)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,565评论 5 6
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,041评论 19 139
  • 1. 介绍 首先让我们来看看TensorFlow! 但是在我们开始之前,我们先来看看Python API中的Ten...
    JasonJe阅读 11,825评论 1 32
  • 这是父亲留下的君子兰,屈指算来,今年整整三十八岁了,它四岁时父亲因病去世,此后这些年一直在我们家生活。这君子兰跟人...
    甜源阅读 636评论 0 1
  • 丢了童谣,也要安好。 大概因为第一次听小九是在深夜的关系,万籁俱寂,灯光透过窗帘若隐若现。《好好》,就是这首歌...
    拥抱星空的憨人阅读 340评论 2 1