如何删除PIP安装的所有软件包? [英] How do I remove all packages installed by PIP?
本文介绍了如何删除PIP安装的所有软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将我的Python安装恢复到其基本状态,以便可以开始使用virtualenv
.是否有一种简单的方法可以只卸载那些在设置了Python之后安装的软件包?
I want to revert my Python install back to its base state so I can start using virtualenv
. Is there an easy way to uninstall only those packages that have been installed after Python was set up?
推荐答案
以下命令应该可以解决问题:
The following command should do the trick:
pip freeze > requirements.txt && pip uninstall -r requirements.txt -y
或者,您可以跳过任何中间文件(即requirements.txt
)的创建:
Alternatively you can skip the creation of any intermediate files (i.e. requirements.txt
):
pip uninstall -y -r <(pip freeze)
这篇关于如何删除PIP安装的所有软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文