Skip to content

Installation over pip fails to import with protobuf 2.6.1 #4

Description

@panmari

Pip freeze reports the following protobuf version

protobuf==2.6.1

However, upon importing I get the following error

Traceback (most recent call last):
  File "/home/panmari/PycharmProjects/tensor_stuff/stuff.py", line 150, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 4, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 13, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/usr/local/lib/python2.7/dist-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/dist-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/dist-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/dist-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'

Do I need a newer version of the protobuf package?

Activity

  1. vrv commented on Nov 9, 2015

    @vrv

    We definitely depend on protobuf 3.0 (it's what we use as a git submodule).

    To help us debug, can you please try following the instructions to install within a virtualenv here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#virtualenv-based-installation- ?

  2. panmari commented on Nov 9, 2015

    @panmari
    ContributorAuthor

    Got it running by uninstalling the distribution-owned numpy package (?) and reinstalling it from pip. Guess they were interfering in some weird way. Thanks for your help!

  3. pannous commented on Dec 9, 2015

    @pannous

    got it running by explicitly installing
    sudo pip install -Iv protobuf==3.0a3

  4. added a commit that references this issue on Oct 28, 2016
  5. added a commit that references this issue on Jan 18, 2017
  6. added a commit that references this issue on Jun 20, 2017
  7. added a commit that references this issue on Jun 22, 2017
  8. added a commit that references this issue on Jun 28, 2017
  9. added 2 commits that reference this issue on Jul 15, 2017
  10. added a commit that references this issue on Jan 31, 2018
  11. 49 remaining items

  12. added 5 commits that reference this issue on Apr 9, 2025
  13. added 2 commits that reference this issue on Mar 9, 2026
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