question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name '_message' from 'google.protobuf.pyext' (/usr/lib/python3.7/site-packages/google/protobuf/pyext/__init__.py)

See original GitHub issue
  • TensorBoard version: tensorboard-1.12.0
  • GNU/Linux, Manjaro
  • Python version: 3.7.1

Issue: Just calling tensorboard fails to load. A bug with protobuf?

Traceback (most recent call last):
  File "/usr/bin/tensorboard", line 11, in <module>
    load_entry_point('tensorboard==1.12.0', 'console_scripts', 'tensorboard')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2343, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2349, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.7/site-packages/tensorboard/main.py", line 45, in <module>
    from tensorboard import default
  File "/usr/lib/python3.7/site-packages/tensorboard/default.py", line 34, in <module>
    import tensorflow as tf
  File "/usr/lib/python3.7/site-packages/tensorflow/__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/usr/lib/python3.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/usr/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
ImportError: cannot import name '_message' from 'google.protobuf.pyext' (/usr/lib/python3.7/site-packages/google/protobuf/pyext/__init__.py)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:23

github_iconTop GitHub Comments

63reactions
gariepyalexcommented, Nov 2, 2018

Found a solution here: https://stackoverflow.com/a/50950265

export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
sudo pip install --upgrade --force-reinstall protobuf
9reactions
david-aucommented, Feb 15, 2019

There’s a recent release of protobuf in Feb (3.7.0rc2), although it’s still a RC build. Install that and it should solve the issue. I’ve tested this on Python 3.7.1 + TensorBoard 1.12.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot import name '_message' from 'google.protobuf.pyext' (c ...
What does the above command do? Why do I get this error message? C:\Windows\system32>python --version Python 3.7.1 C:\Windows ...
Read more >
Error "protobuf Import" Is Reported on the Python Dependency ...
Symptom. During use of MindConverter, '_message' cannot be imported from the google.protobuf.pyext package, as shown in Figure 1.
Read more >
google.protobuf.descriptor — Apache Beam documentation
The name of the class is required in case the options message is None and has to ... _options from google.protobuf import descriptor_pb2...
Read more >
Trying to use C++ implementation of python but ...
I initially used a pure python implementation of protocol buffers, but I changed it later to use the c++ ... ImportError: cannot import...
Read more >
tensorflow - Bountysource
ImportError : cannot import name '_message' from 'google.protobuf.pyext' (/usr/lib/python3.7/site-packages/google/protobuf/pyext/__init__.py)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found