Roh*_*han 5 python numpy python-2.7 tensorflow
我是初学者,我尝试根据网站上给出的说明在 Macbook 上安装张量流。
sudo easy_install pip
sudo easy_install --upgrade six
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
Run Code Online (Sandbox Code Playgroud)
安装后,当我尝试导入张量流时,出现以下错误:
>>> import tensorflow
RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 50, in <module>
from tensorflow.python.framework.framework_lib import *
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/framework_lib.py", line 62, in <module>
from tensorflow.python.framework.ops import Graph
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 40, in <module>
from tensorflow.python.framework import versions
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/versions.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Python/2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import
>>>
Run Code Online (Sandbox Code Playgroud)
我是 python 的新手,我在互联网上尝试了一些解决方案,但到目前为止都没有奏效。也许错误是由于 pip 安装。从 2 天起,我就被困在这个问题上。感谢帮助!
所以最后我所做的就是删除了tensorflow、pip 和所有东西。问题是我使用的是 Mac OSX python,因此我遇到了问题。我使用homebrew安装python,然后创建virtualenv并使用pip再次安装tensorflow。之后就开始工作了。
| 归档时间: |
|
| 查看次数: |
4168 次 |
| 最近记录: |