2016-05-02 9 views
3

In ipythonWarum funktioniert der Import von google.protobuf in ipython, nicht aber in Python?

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]: 

jedoch 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 
>>> 

Warum dieses seltsame Fehler passiert? Bitte hilf mir herauszufinden.

+0

Mögliches Duplikat von ["ImportError: Kein Modul namens" beim Versuch, Python-Skript auszuführen] (http://stackoverflow.com/questions/15514593/importerror-no-module-named-when-trying-to-run-) Python-Skript) – Selcuk

Antwort

1

Vielleicht liegt das an einigen Konflikten zwischen meinem Anaconda-Paket von Protobuf und dem Protobuf des Systems. Nach der Deinstallation von Protobuf pip uninstall protobuf conda uninstall protobuf und Neuinstallation conda install protobuf alles geht jetzt gut.