怎么删除python安装包

藏色散人
发布: 2019-07-01 11:23:52
原创
5543 人浏览过

怎么删除python安装包

怎么删除python安装包

python 安装模块,一般pip 或者 python setup.py install..反之 卸载的话,一般是直接删除module 文件夹,或者通过record记录去自动删除,具体如下。

一、源码包安装的删除

我们使用 python setup.py install 来安装python包,但是如何卸载呢?

只能手动删除安装的文件,可以使用如下命令:

linux下的删除:

# python setup.py install --record files.txt 记录安装后文件的路径

# cat files.txt | xargs rm -rf 删除这些文件

windows下的删除:

C:\selenium-2.43.0>python setup.py install --record ./record.txt

C:\selenium-2.43.0>FOR /F %f in (record.txt) DO del %f

二、easy_install 安装的删除

以下从豆瓣上看到方法

If you have replaced a package with another version, then you can just delete the package(s) you don't need by deleting the PackageName-versioninfo.egg file or directory (found in the installation directory).

If you want to delete the currently installed version of a package (or all versions of a package), you should first run:

easy_install -m PackageName
登录后复制

This will ensure that Python doesn't continue to search for a package you're planning to remove. After you've done this, you can safely delete the .egg files or directories, along with any scripts you wish to remove.

就是运行:easy_install -m PackageName

完了,你在C:\Python25\Lib\site-packages\下,删除模块文件夹就好了。

相关推荐:《Python教程

以上是怎么删除python安装包的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!