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