Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import after installing with pip #43

Closed
piiswrong opened this issue Nov 9, 2015 · 2 comments
Closed

Cannot import after installing with pip #43

piiswrong opened this issue Nov 9, 2015 · 2 comments

Comments

@piiswrong
Copy link
Contributor

I installed the binary with gpu support from pip, but when I import it, I get this error:

import tensorflow
Traceback (most recent call last):
File "", line 1, in
File "/home/jxie/anaconda/lib/python2.7/site-packages/tensorflow/init.py", line 4, in
from tensorflow.python import *
File "/home/jxie/anaconda/lib/python2.7/site-packages/tensorflow/python/init.py", line 13, in
from tensorflow.core.framework.graph_pb2 import *
File "/home/jxie/anaconda/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 8, in
from google.protobuf import reflection as _reflection
File "/home/jxie/anaconda/lib/python2.7/site-packages/google/protobuf/reflection.py", line 56, in
from google.protobuf.pyext import cpp_message as message_impl
File "/home/jxie/anaconda/lib/python2.7/site-packages/google/protobuf/pyext/cpp_message.py", line 42, in
class GeneratedProtocolMessageType(_message.MessageMeta):
AttributeError: 'module' object has no attribute 'MessageMeta'

@mrry
Copy link
Contributor

mrry commented Nov 9, 2015

Hi there,

Can you check whether the PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION environment variable is set in your shell? It looks like it might be set to "cpp", which is causing an issue with the version of protobuf that ships with the binary distribution.

The following should work:

export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
python
>>> import tensorflow as tf
>>>

@piiswrong
Copy link
Contributor Author

That fixed it.
Thanks a lot!

@mrry mrry closed this as completed Nov 9, 2015
ilblackdragon added a commit to ilblackdragon/tensorflow that referenced this issue Mar 9, 2016
tarasglek pushed a commit to tarasglek/tensorflow that referenced this issue Jun 20, 2017
Updated to the latest version of TF-Slim
lissyx added a commit to lissyx/tensorflow that referenced this issue Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants