Closed
Description
This is what happens:
~: pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Collecting tensorflow==0.5.0 from https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Downloading https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl (9.8MB)
100% |████████████████████████████████| 9.8MB 51kB/s
Collecting six>=1.10.0 (from tensorflow==0.5.0)
Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.9.2 in /usr/local/lib/python2.7/site-packages (from tensorflow==0.5.0)
Installing collected packages: six, tensorflow
Found existing installation: six 1.9.0
Uninstalling six-1.9.0:
Successfully uninstalled six-1.9.0
Successfully installed six-1.10.0 tensorflow-0.5.0
~: python
Python 2.7.10 (default, Jul 13 2015, 12:05:58)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 13, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 16, in <module>
from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
File "/usr/local/lib/python2.7/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 16, in <module>
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
File "/usr/local/lib/python2.7/site-packages/tensorflow/core/framework/tensor_pb2.py", line 16, in <module>
from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
File "/usr/local/lib/python2.7/site-packages/tensorflow/core/framework/tensor_shape_pb2.py", line 22, in <module>
serialized_pb=_b('\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow\"d\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tb\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'syntax'
Activity
vrv commentedon Nov 9, 2015
Okay, I was able to reproduce this in virtualenv by installing protobuf==2.6.1
The short answer is that we depend on protobuf 3.0.0, and having the protobuf pip library installed seems to interfere with ours.
Two solutions:
I was able to do both in virtualenv and they worked -- let me know if either suffices for you. We might add protobuf >= 3 to our whl dependencies if so.
flyingmutant commentedon Nov 9, 2015
Tensorflow does not bring dependency on protobuf:
Installing protobuf3 before does not help, either:
Unless I am missing something, neither of the solutions work for me. Latest OS X, python2 + python3 installed from Homebrew.
alejandro-isaza commentedon Nov 9, 2015
This fixed the problem for me:
vrv commentedon Nov 9, 2015
flyingmutant: to appease my curiosity, can you let us know what you get when you do the following in python:
(it's possible google.protobuf.version doesn't exist either in one of the environments I've tested).
Basically the symptom of the problem is that python is finding the older version of the protobuf library that doesn't support the generated python proto3 we require.
VikramTiwari commentedon Nov 9, 2015
Found the same issue on my end.
This issue (pypa/pip#3165) has more insight into the same. And according to this its the issue with
six
library being preinstalled in El Captain systems.Moreover there seems to be no solution as of now except installing python locally using brew rather than using pre-installed package by Apple.
flyingmutant commentedon Nov 9, 2015
@vrv I've got
AttributeError: 'module' object has no attribute '__version__'
for both 3.0.0a1 and 3.0.0a3 (which is the latest you can install with pip).I've found what fixes the issue for me:
$ brew uninstall protobuf $ pip uninstall protobuf $ pip install 'protobuf>=3.0.0a3' $ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
It appears that Homebrew's protobuf package was causing the issues. Removing it, then installing protobuf3 with pip does the trick.
dvj commentedon Nov 9, 2015
For the protobuf issue above on OS X, not only should you
pip uninstall protobuf
to get rid of protobuf 2.x, but make sure youbrew uninstall protobuf
if you are using homebrew.@VikramTiwari : that is a different issue, already addressed in the "common problems" section of the 'Get Started' page
VikramTiwari commentedon Nov 9, 2015
@dvj Yup! Got it just now. Instructions by @flyingmutant did the trick.
vrv commentedon Nov 9, 2015
Thanks for the help debugging everyone! We'll try to update our 'common problems' section soon to include these suggestions.
Yangqing commentedon Nov 9, 2015
By the way, if you would like to use homebrew, you can install protobuf 3 via:
brew install --devel protobuf
For more details please refer to grpc/grpc-experiments#162
iamed2 commentedon Nov 9, 2015
I was able to solve this by doing
brew reinstall --devel protobuf
, which installs3.0.0a1
. Feel free to close the issue whenever you update the docs.liuyipei commentedon Nov 10, 2015
I have the same problem, but my protobuf is apparently up-to-date?
Here is the output to
pip show numpy protobuf
Here is the output to
uname -a
. My machine runs Ubuntu 14.04 LTS.Here are the details of the output:
95 remaining items