Skip to content

Cannot import after installing with pip #43

Description

@piiswrong

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'

Activity

  1. mrry commented on Nov 9, 2015

    @mrry
    Contributor

    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
    >>>
  2. piiswrong commented on Nov 9, 2015

    @piiswrong
    ContributorAuthor

    That fixed it.
    Thanks a lot!

  3. added a commit that references this issue on Mar 9, 2016
    8f4ef46
  4. added a commit that references this issue on Jun 20, 2017
  5. added a commit that references this issue on Nov 30, 2017
  6. added 3 commits that reference this issue on Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions