我正在尝试将theano安装在virtualenv中:
(dnouri_tut)[xxx@xxx virtualenvs]$ pip install Theano
但是我收到以下错误:
Installing collected packages: scipy, numpy, Theano
Running setup.py install for scipy
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-JcZ_Qe/scipy/setup.py", line 249, in <module>
setup_package()
File "/tmp/pip-build-JcZ_Qe/scipy/setup.py", line 237, in setup_package
from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core
Complete output from command /home/xxx/virtualenvs/dnouri_tut/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JcZ_Qe/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-T3NhHj-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/virtualenvs/dnouri_tut/include/site/python2.6:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-JcZ_Qe/scipy/setup.py", line 249, in <module>
setup_package()
File "/tmp/pip-build-JcZ_Qe/scipy/setup.py", line 237, in setup_package
from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core
----------------------------------------
Command "/home/xxx/virtualenvs/dnouri_tut/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JcZ_Qe/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-T3NhHj-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/virtualenvs/dnouri_tut/include/site/python2.6" failed with error code 1 in /tmp/pip-build-JcZ_Qe/scipy
我不想依赖任何系统包,所以我没有使用“--system-site-packages”选项来创建我的virtualenv。
有人可以帮忙吗?
答案 0 :(得分:0)
正如user1615070所指出的,我只需在安装Theano之前在我的virtualenv中安装numpy和scipy(不使用系统版本)。
答案 1 :(得分:0)
更具体地说,Theano(至少版本0.8)具有specific command in its documentation。这是:
virtualenv --system-site-packages -p python2.7 theano-env