跳转到主要内容

删除一个包及其未使用的依赖项

项目描述

https://img.shields.io/pypi/dm/pip-autoremove.svg https://img.shields.io/pypi/v/pip-autoremove.svg https://img.shields.io/pypi/l/pip-autoremove.svg

删除一个包及其未使用的依赖项。

快速入门

首先,安装 pip-autoremove

$ pip install pip-autoremove

安装一个具有依赖项的包,例如 Flask

$ pip install Flask

...
Successfully installed Flask Werkzeug Jinja2 itsdangerous markupsafe
Cleaning up...

卸载它及其所有未使用的依赖项

$ 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

一次删除多个包及其依赖项

$ 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)
...

用法

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.

安装

$ pip install pip-autoremove

版权所有 2014 invl

根据Apache许可证版本2.0(“许可证”)许可;除非根据适用法律或书面同意,否则不得使用此文件,除非符合许可证。您可以在以下位置获得许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0

除非适用法律要求或书面同意,否则在许可证下分发的软件按“现状”基础分发,不提供任何明示或暗示的保证或条件。有关许可证管理权限和限制的具体语言,请参阅许可证。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

pip-autoremove-0.10.0.tar.gz (4.5 kB 查看哈希值)

上传于

构建分发

pip_autoremove-0.10.0-py2.py3-none-any.whl (5.0 kB 查看哈希值)

上传于 Python 2 Python 3

由以下支持