3

In ipython

Python 2.7.11 |Anaconda 2.4.1 (64-bit)
IPython 3.1.0 -- An enhanced Interactive Python.

In [1]: import google.protobuf

In [2]:

However in python:

Python 2.7.11 |Anaconda 2.4.1 (64-bit)
>>> import google.protobuf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named protobuf
>>>

Why this strange error happened? Please help me figure out.

Meta Fan
  • 1,545
  • 2
  • 17
  • 28
  • Possible duplicate of ["ImportError: No module named" when trying to run Python script](http://stackoverflow.com/questions/15514593/importerror-no-module-named-when-trying-to-run-python-script) – Selcuk May 02 '16 at 03:40

1 Answers1

1

Maybe this is due to some conflicts between my anaconda package of protobuf and the system's protobuf. After uninstalling protobuf pip uninstall protobuf conda uninstall protobuf and reinstalling conda install protobuf everything goes fine now.

Meta Fan
  • 1,545
  • 2
  • 17
  • 28