您的位置:首页 > 运维架构

Unable to import Tensorflow “No module named copyreg”

2016-05-20 20:32 696 查看
http://stackoverflow.com/questions/33656551/unable-to-import-tensorflow-no-module-named-copyreg

Another simple way I tried to fix this is to edit the source code and
python_message.py
and
change the line
import
six.moves.copyreg as copyreg
into
from
six.moves import copyreg
.

Of course you might need to change the permission of this read-only file in order to modify it.

$ python
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
from tensorflow.python import *
File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 13, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 8, in <module>
from google.protobuf import reflection as _reflection
File "/Library/Python/2.7/site-packages/google/protobuf/reflection.py", line 58, in <module>
from google.protobuf.internal import python_message as message_impl
File "/Library/Python/2.7/site-packages/google/protobuf/internal/python_message.py", line 59, in <module>
import six.moves.copyreg as copyreg
ImportError: No module named copyreg
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: