是否使用“pip"卸载软件包?还删除依赖包? [英] Does uninstalling a package with "pip" also remove the dependent packages?

查看:68
本文介绍了是否使用“pip"卸载软件包?还删除依赖包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您使用 pip 安装包时,所有必需的包也将随它一起安装(依赖项).卸载该包是否也会删除依赖包?

解决方案

不,它不会卸载依赖包.它只删除指定的包:

$ pip install specloud$ pip freeze # 这里所有的包都是specloud包的依赖

<块引用>

figleaf==0.6.1
鼻子==1.1.2
匹诺曹==0.3
specloud==0.4.5

$ pip卸载specloud$ pip 冻结

<块引用>

figleaf==0.6.1
鼻子==1.1.2
匹诺曹==0.3

如您所见,这些包是 specloud 的依赖项,它们仍然存在,但不是 specloud 包本身.

如下所述,您可以安装和使用 pip-autoremove 实用程序来删除包加上未使用的依赖项.

When you use pip to install a package, all the required packages will also be installed with it (dependencies). Does uninstalling that package also remove the dependent packages?

解决方案

No, it doesn't uninstall the dependencies packages. It only removes the specified package:

$ pip install specloud
$ pip freeze # all the packages here are dependencies of specloud package

figleaf==0.6.1
nose==1.1.2
pinocchio==0.3
specloud==0.4.5

$ pip uninstall specloud
$ pip freeze

figleaf==0.6.1
nose==1.1.2
pinocchio==0.3

As you can see those packages are dependencies from specloud and they're still there, but not the specloud package itself.

As mentioned below, You can install and use the pip-autoremove utility to remove a package plus unused dependencies.

这篇关于是否使用“pip"卸载软件包?还删除依赖包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆