繁体   English   中英

Linux Fedora virtualenv网站程序包的位置不正确

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM