怎麼刪除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.txtC:\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 you want to delete the currently installed version of a package (or all versions of a version 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中文網其他相關文章!