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,552評論 5 6
  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,991評論 19 139
  • 1. 介紹 首先讓我們來看看TensorFlow! 但是在我們開始之前,我們先來看看Python API中的Ten...
    JasonJe閱讀 11,812評論 1 32
  • 這是父親留下的君子蘭,屈指算來,今年整整三十八歲了,它四歲時父親因病去世,此后這些年一直在我們家生活。這君子蘭跟人...
    甜源閱讀 627評論 0 1
  • 丟了童謠,也要安好。 大概因為第一次聽小九是在深夜的關系,萬籟俱寂,燈光透過窗簾若隱若現?!逗煤谩?,就是這首歌...
    擁抱星空的憨人閱讀 337評論 2 1