0
我在MacOS上有Python 2.7。在Python 2.7导入时出现Tensorflow错误
我一直在使用如下巴泽勒内置Tensorflow从源:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
我收到以下错误,而我试图导入Tensorflow包。
进口tensorflow为TF
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
ImportError: No module named pywrap_tensorflow_internal
你有没有做过每一步?建立bazel后,您需要运行它生成的脚本,然后使用pip安装生成的包。 –
我错过了$ sudo pip install /tmp/tensorflow_pkg/tensorflow-1.1.0-py2-none-any.whl感谢它的工作。 – Biranchi