我正在尝试在没有root权限的情况下在Ubuntu 12.04上为python设置虚拟环境。我在我的系统上的/micehome/jbruce/Documents/Code/Python/IPythonNotebooks/learning_venv
中设置了虚拟环境。 learning_venv
是我选择使用的虚拟环境的名称。
我通过以下方式进行设置:
pip install --user virtualenv
export PATH=$PATH:/micehome/jbruce/.local/bin
导航到:
/micehome/jbruce/Documents/Code/Python/IPythonNotebooks/
使用以下命令创建并激活虚拟环境:
virtualenv learning_venv
source learning_venv/bin/activate
确认正在引用正确版本的pip和python:
which python // <basepath>/learning_venv/bin/python
which pip // <basepath>/learning_venv/bin/pip
检查了最初安装的软件包:
ConfigArgParse==0.9.3
Cython==0.20.1
generate-deformation-fields==0.0.0
matplotlib==1.3.1
minc-util==0.1.1
morphology==0.56
nose==1.3.1
Numeric==24.2
numexpr==2.1
numpy===1.9.0.dev-3a4030c
py-minc==0.89.1
pydpiper==1.12
pyminc==0.41
pyparsing==2.0.1
Pyro==3.13
python-dateutil==2.2
python-stuffs==0.1.2
scipy===0.15.0.dev-4f35dac
six==1.6.1
tables==2.2.1
vessel-tracking==0.8.2
wheel==0.24.0
这些似乎是我工作场所使用的一堆包。为什么会自动包含这些包?我甚至尝试过virtual --no-site-packages learning_venv
,但没有任何区别。
无论如何,问题是当我运行pip install pandas
时。堆栈跟踪:
Collecting pandas
Using cached pandas-0.16.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-q_IpWD/pandas/setup.py", line 631, in <module>
**setuptools_kwargs)
File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2029, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 825, in best_match
return self.obtain(req, installer) # try and download/install
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 837, in obtain
return installer(requirement)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 272, in fetch_build_egg
dist = self.__class__({'script_args':['easy_install']})
从225到272的错误以递归方式出现,直到堆栈跟踪的最后,当它稍微改变为:
"/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2029, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 579, in resolve
env = Environment(self.entries)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 748, in __init__
self.scan(search_path)
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 777, in scan
for dist in find_distributions(item):
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1742, in find_on_path
path_item, os.path.join(path_item,'EGG-INFO')
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2298, in from_filename
**kw
File "/axiom2/projects/software/arch/linux-precise/python/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2140, in from_location
basename, ext = os.path.splitext(basename)
File "/micehome/jbruce/Documents/Code/Python/IPythonNotebooks/learning_venv/lib/python2.7/posixpath.py", line 96, in splitext
return genericpath._splitext(p, sep, altsep, extsep)
File "/micehome/jbruce/Documents/Code/Python/IPythonNotebooks/learning_venv/lib/python2.7/genericpath.py", line 101, in _splitext
if p[filenameIndex] != extsep:
RuntimeError: maximum recursion depth exceeded in cmp
----------------------------------------
不确定这里发生了什么,我找到了一些相关的线程,但他们没有帮助我。谢谢!