0

I am just pasting the output of my bash shell which could be quite explicit. Running IPython:

petrux@orion:~/Projects/dket$ ipython
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import tensorflow as tf
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-41389fad42b5> in <module>()
----> 1 import tensorflow as tf

/home/petrux/.local/lib/python3.5/site-packages/tensorflow/__init__.py in <module>()
     22 
     23 # pylint: disable=wildcard-import
---> 24 from tensorflow.python import *
     25 # pylint: enable=wildcard-import
     26 

/home/petrux/.local/lib/python3.5/site-packages/tensorflow/python/__init__.py in <module>()
     73 
     74 # Protocol buffers
---> 75 from tensorflow.core.framework.graph_pb2 import *
     76 from tensorflow.core.framework.node_def_pb2 import *
     77 from tensorflow.core.framework.summary_pb2 import *

/home/petrux/.local/lib/python3.5/site-packages/tensorflow/core/framework/graph_pb2.py in <module>()
      4 import sys
      5 _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
----> 6 from google.protobuf import descriptor as _descriptor
      7 from google.protobuf import message as _message
      8 from google.protobuf import reflection as _reflection

ImportError: No module named 'google.protobuf'; 'google' is not a package

while running the regular python interpreter:

petrux@orion:~/Projects/dket$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> 

I am running Ubuntu 16.04 as OS. Thanks in advance.

petrux
  • 1,743
  • 1
  • 17
  • 30
  • 1
    Maybe this will help you: http://stackoverflow.com/questions/31308812/no-module-named-google-protobuf – ml4294 Apr 24 '17 at 17:20
  • most likely you have two python distributions? try to update ipython? – fabrizioM Apr 24 '17 at 19:05
  • @fabrizioM done (via `apt-get`) but nothing changed. – petrux Apr 27 '17 at 16:56
  • @ml4294 in the thread you pointed out there is no answer marked as correct. Anyway, I tried the uninstall-reinstall trick but it didn't worked. By the way: this happens *only* with IPython3. – petrux Apr 27 '17 at 17:03

0 Answers0