Unable to import Tensorflow “No module named copyreg”

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 "", line 1, in 
  File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 4, in 
    from tensorflow.python import *
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 13, in 
    from tensorflow.core.framework.graph_pb2 import *
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 8, in 
    from google.protobuf import reflection as _reflection
  File "/Library/Python/2.7/site-packages/google/protobuf/reflection.py", line 58, in 
    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 
    import six.moves.copyreg as copyreg
ImportError: No module named copyreg



你可能感兴趣的:(Tensorflow)