Stack Exchange
Cant run tensorflow on ubuntu 16.04 using python 2.7
I have installed the tensorflow using pip in python 2.7.
When I try to test the tensorflow in python, all I get is this message:
ubuntu@ubuntu:~$ python
Python 2.7.15 |Anaconda, Inc.| (default, May  1 2018, 23:32:55) 
[GCC 7.2.0] on linux2
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 "/home/anto/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/anto/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/home/anto/anaconda2/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/home/anto/anaconda2/lib/python2.7/site-packages/google/protobuf/descriptor.py", line 113
    class DescriptorBase(metaclass=DescriptorMetaclass):
                                  ^
SyntaxError: invalid syntax
>>> 

I am currently running on:

ubuntu 16.04
ros1 kinematic
python 2.7
keras 2.6
tensorflow 1.14
protobuf 3.18.0


What version of protobuf do you have installed?

using pip show,
3.18.0

i have tried re-install a protobuf version of python 2.7 and tensorflow 1.x
this is all i get to solve this problem

encontered error in Tensorflow 1.8 Request you to uninstall by using
pip uninstall protobuf and try installing pip install protobuf==3.8
encontered error in Tensorflow 1.14 Request you to uninstall by using
pip uninstall protobuf and try installing pip install protobuf==3.9

it works for me

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
