[英]Linux Fedora virtualenv site-packages incorrect location
我剛嘗試設置在新的虛擬環境中安裝應用程序。
要創建我的虛擬環境,我使用了:
virtualenv -p /usr/bin/python2.6/python2.6 rollEnv2 --no-site-packages
然后安裝該應用程序,我使用了:
python setup.py install
但最后我得到一個錯誤:
File "/home/aaron/workspace/rollEnv2/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
好吧,讓我們嘗試為該應用程序提供服務:
paster serve development.ini
錯誤:
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 588, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (WebOb 1.0.8 (/usr/lib/python2.7/site-packages), Requirement.parse('WebOb==0.9.6.1'))
(rollEnv2)
似乎是一個明顯的錯誤,讓我們:
easy_install WebOb==0.9.6.1
但:
WebOb 0.9.6.1 is already the active version in easy-install.pth
那么這可能是什么問題呢? 好像簡易安裝是在基本Python目錄中而不是virtualenv目錄中查找。 但是理想情況下,修復原始的AttributeError: 'NoneType' object has no attribute 'clone'
會很好AttributeError: 'NoneType' object has no attribute 'clone'
。
我已經四處搜尋,但似乎無法找到一個合適的答案。
有任何想法嗎?
首先,我建議您也嘗試使用mkvirtualenv ,為什么您仍在使用easy_install而不切換到pip?
默認情況下,virtualenv使用Distribute not setuptools。 我認為您正在使用setuptools,因此只需使用setuptools重新創建您的環境。
從virtualenv:
--distribute Ignored. Distribute is used by default. See
--setuptools to use Setuptools instead of Distribute.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.