
错误信息(请检查屏幕截图图片):
ImportError: cannot import name symbol_database
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
Process finished with exit code 1非常感谢!

发布于 2016-05-03 18:41:57
我尝试使用以下示例代码重现您遇到的问题:
import tensorflow as tf
hello = tf.constant('Hello, Tensorflow!')但我没能做到。我可以在PyCharm和命令行(exit code 0)中运行脚本,而不会出现问题。
这些是tensorflow 0.8.0工作所需的包(及其版本):
numpy==1.11.0
protobuf==3.0.0b2
six==1.10.0我在MacOSX10.11.4上使用PyCharm Community 2016.1.2和Python2.7.10
您是如何安装tensorflow**?**的?您应该通过pip安装(如站点:setup.html#pip-installation所推荐的)。
对于Python2,Mac,下面是安装命令:pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
https://stackoverflow.com/questions/37011603
复制相似问题