我在安装Keras时遇到问题。首先我认为是因为我使用的是pip
的旧版本,所以我升级了:
$ pip install --user --upgrade pip
You are using pip version 7.1.0, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
Using cached pip-9.0.3-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-9.0.3
然后我再次尝试安装Keras:
$ pip install --user keras
You are using pip version 7.1.0, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting keras
Using cached Keras-2.1.5-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.14 in /path/to/python/2.7.8/intel/lib/python2.7/site-packages (from keras)
Collecting numpy>=1.9.1 (from keras)
Using cached numpy-1.14.2.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/local/tmp/pip-build-VXIWgu/numpy/setup.py", line 34, in <module>
raise RuntimeError("Python version 2.7 or >= 3.4 required.")
RuntimeError: Python version 2.7 or >= 3.4 required.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /local/tmp/pip-build-VXIWgu/numpy
有趣的是,即使我成功安装了pip
版本9.0.3,它仍然使用较旧的pip
。
错误说我需要Python版本2.7或&gt; = 3.4。但是,我有Python 2.7:
$ python
Python 2.7.8 (default, Sep 18 2014, 11:21:42)
[GCC Intel(R) C++ gcc 4.4 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
从this question开始,我认为问题可能是TensorFlow。所以我检查了我的版本:
>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:105] Couldn't open CUDA library libcudnn.so.4.0.7. LD_LIBRARY_PATH: /path/to/python/2.7.8/intel/lib:/path/to/slurm/15.08.10/lib
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3304] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so.7.5 locally
>>> tf.__version__
'0.10.0rc0'
我显然安装了TensorFlow。
那我怎么解决这个问题呢? (注意:我没有管理员权限 - 无法使用sudo
)。
答案 0 :(得分:0)
如果您想要更好地控制您的环境,可以创建一个虚拟环境
pip install virtualenv
virtualenv -p=python2.7 controlledENV