埃尔卡皮坦操作系统在这里。我一直在尝试找到将 Tensorflow 导入我的 ipython 笔记本的解决方法,但到目前为止还没有运气。
像论坛中的许多人一样,由于六个包,我也遇到了安装 tensorflow 的问题。在对 brew 进行一些烦躁之后,我能够安装
brew link gdbm
brew install python
rew linkapps python
sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
我收到一条消息说 tensorflow 已正确安装。即使我这样做了,我也sudo pip install tensorflow
收到了消息:
Requirement already satisfied (use --upgrade to upgrade): tensorflow in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /Library/Python/2.7/site-packages (from tensorflow)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.9.2 in /usr/local/lib/python2.7/site-packages (from tensorflow)
但是,当我在我的 ipython 笔记本上并且我做了一个时,import tensorflow
我收到了消息:ImportError: No module named tensorflow
我进一步挖掘并在导入时发现了这个错误:
In [1]: import tensorflow
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-a649b509054f> in <module>()
----> 1 import tensorflow
/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py in <module>()
2 # module.
3 # pylint: disable=wildcard-import
----> 4 from tensorflow.python import *
/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py in <module>()
11
12 import tensorflow.python.platform
---> 13 from tensorflow.core.framework.graph_pb2 import *
14 from tensorflow.core.framework.summary_pb2 import *
15 from tensorflow.core.framework.config_pb2 import *
/usr/local/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py in <module>()
6 from google.protobuf import descriptor as _descriptor
7 from google.protobuf import message as _message
----> 8 from google.protobuf import reflection as _reflection
9 from google.protobuf import symbol_database as _symbol_database
10 from google.protobuf import descriptor_pb2
/usr/local/lib/python2.7/site-packages/google/protobuf/reflection.py in <module>()
56 from google.protobuf.pyext import cpp_message as message_impl
57 else:
---> 58 from google.protobuf.internal import python_message as message_impl
59
60 # The type of all Message classes.
/usr/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py in <module>()
57
58 import six
---> 59 import six.moves.copyreg as copyreg
60
61 # We use "as" to avoid name collisions with variables.
ImportError: No module named copyreg