欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

linux下安裝easy_install的方法

 更新時(shí)間:2013年02月10日 18:42:00   作者:  
python中的easy_install工具,類似于Php中的pear,或者Ruby中的gem,或者Perl中的cpan,那是相當(dāng)?shù)乃嵬崃巳绻胧褂?/div>

如果想使用easy_install工具,可能需要先安裝setuptools,不過更酷的方法是使用ez_setup.py腳本:

復(fù)制代碼 代碼如下:

wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

安裝完后,最好確保easy_install所在目錄已經(jīng)被加到PATH環(huán)境變量里:

復(fù)制代碼 代碼如下:

Windows: C:\Python25\Scripts
Linux: /usr/local/bin

比如說要安裝Python的MySQL支持,可以執(zhí)行如下命令,系統(tǒng)會(huì)自動(dòng)在pypi網(wǎng)站列表里查找相關(guān)軟件包:

復(fù)制代碼 代碼如下:

easy_install MySQL-python

如果你在Windows+python2.5上執(zhí)行如上命令的話,可能會(huì)出現(xiàn)如下錯(cuò)誤:

復(fù)制代碼 代碼如下:

Processing MySQL-python-1.2.3c1.tar.gz
Running MySQL-python-1.2.3c1\setup.py -q bdist_egg --dist-dir c:\docume~1\...
\locals~1\temp\easy_install-fvvfve\MySQL-python-1.2.3c1\egg-dist-tmp-q9moxf
error: The system cannot find the file specified

出現(xiàn)這類錯(cuò)誤的原因是選錯(cuò)了版本,針對(duì)這個(gè)案列,我們可以顯式指定軟件包的版本號(hào):

復(fù)制代碼 代碼如下:

easy_install "MySQL-python==1.2.2"

通過easy_install安裝軟件,相關(guān)安裝信息會(huì)保存到easy-install.pth文件里,路徑類似如下形式:

復(fù)制代碼 代碼如下:

Windows:C:\Python25\Lib\site-packages\easy-install.pth
Linux:/usr/local/lib/python25/site-packages/easy-install.pth

如果想刪除通過easy_install安裝的軟件包,比如說:MySQL-python,可以執(zhí)行命令:

復(fù)制代碼 代碼如下:

easy_install -m MySQL-python

此操作會(huì)從easy-install.pth文件里把MySQL-python的相關(guān)信息抹去,剩下的egg文件,手動(dòng)刪除即可。

相關(guān)文章

最新評(píng)論