删除Python easy_install安装软件

January 12th, 2011 1 comment

python的easy_install是很方便的安装体系,可是一般来说setup.py没有deinstall的选项,那么如何删除已经安装的egg呢?

easy_install -mxN Genshi
然后下面类似的提示:

install_dir /usr/local/lib/python2.6/dist-packages/
Processing Genshi-0.6-py2.6.egg
Removing Genshi 0.6 from easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

    pkg_resources.require("Genshi")  # latest installed version
    pkg_resources.require("Genshi==0.6")  # this exact version
    pkg_resources.require("Genshi>=0.6")  # this version or higher

然后删除目录:

rm -rf /usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg