如何完全卸载Python及其所有包?
我安装了一些软件包,但我认为某些软件包已损坏或与版本冲突
是否有一个好方法来卸载每个软件包和 python 本身?
I installed some packages , but I think either some of the packages corrupted or are conflicting with versions
Is there a good way to just uninstall every package and python itself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想删除已安装的所有软件包(而不是所有 Python),则需要删除您的
site-packages
目录。要找到它,请从 Python 运行
>>> import some_package
(其中some_package
是您已安装的软件包;setuptools
是您可能拥有的软件包),然后运行 some_package.__file__
。输出应类似于/path/to/site-packages/distribute-0.6.19-py2.6.egg/setuptools/__init__.pyc
。删除(或者更好的是重命名)并重新创建/path/to/site-packages
。这将删除您安装的所有内容。If you just want to remove all the packages you've installed (as opposed to all of Python), you'd want to nuke your
site-packages
directory.To find it, from Python run
>>> import some_package
(wheresome_package
is a package you've installed;setuptools
is one you're likely to have), then runsome_package.__file__
. The output should be something like/path/to/site-packages/distribute-0.6.19-py2.6.egg/setuptools/__init__.pyc
. Delete (or, better yet, rename) and recreate/path/to/site-packages
. That will get rid of everything you've installed.