在 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]:
但是在 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
>>>
为什么会出现这个奇怪的错误?请帮我弄清楚。
最佳答案
可能是我的anaconda包的protobuf和系统的protobuf有些冲突。卸载protobuf后
pip 卸载 protobuf
conda 卸载 protobuf
并重新安装
conda 安装 protobuf
现在一切顺利。
关于python - 为什么 google.protobuf 的导入在 ipython 中可以正常工作,但在 python 中却不行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36974629/