我正在尝试安装tensorflow并遇到了一些困难。这是终端日志:
~/models/syntaxnet/tensorflow$ ./configure
Please specify the location of python. [Default is /usr/local/bin/python]:
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] n
No Google Cloud Platform support will be enabled for TensorFlow
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/john/.local/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/home/john/.local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/john/.local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/john/.local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/john/.local/lib/python2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: /home/john/.local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString
ERROR: Problem getting numpy include path. Is numpy installed?
我相信我安装了所有必备软件包。我确实在安装其中一些时遇到了麻烦。我安装错误了吗? 有没有办法检查/重新安装?
答案 0 :(得分:0)
尝试将--action_env PYTHON_BIN_PATH=/usr/bin/python
添加到bazel构建命令中。
这样bazel build命令变成类似
bazel build --config=opt --action_env PYTHON_BIN_PATH=/usr/bin/python //tensorflow/tools/pip_package:build_pip_package
我以前有过同样的问题。感谢this answer解决它。
如果您使用的是python 3,请将/usr/bin/python
更改为/usr/bin/python3
或您的python所在的任何地方。