我在安装 iPython 的 PyZMP 依赖项时遇到问题。我尝试了很多方法,例如使用 pip/brew,但最终还是使用手动安装包这个答案.
Now, pip list packages
产生以下结果
pyzmq (14.2.0-dev)
pyzmq-static (2.2)
(我也尝试过使用 pyzmq-static)。
另外,我的蟒蛇蛋显然出现在正确的位置:
ls /usr/local/lib/python2.7/site-packages/ | grep "pyzmq"
pyzmq-14.2.0_dev-py2.7.egg-info
pyzmq_static-2.2-py2.7.egg-info
此外:
which python
/usr/local/bin/python
echo $PYTHONPATH
/usr/local/lib/python:
但是,当我尝试导入时
Python 2.7.6 (default, Mar 20 2014, 17:55:13)
In [1]: import pyzmq
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-2faa556e5dc0> in <module>()
----> 1 import pyzmq
ImportError: No module named pyzmq
任何故障排除帮助将不胜感激!
更新:我可以列出 python 中的 zmq 模块,但不能列出 pyzmq 模块:
>>help('modules zmq')
Here is a list of matching modules. Enter any module name to get more help.
buildutils - utilities for building pyzmq.
buildutils.constants - script for generating files that involve repetitive
updates for zmq constants.
buildutils.detect - Detect zmq version
zmq - Python bindings for 0MQ.
...
zmqversion - A simply script to scrape zmq.h for the zeromq version.
IPython.consoleapp - A minimal application base mixin for all ZMQ based
IPython frontends.
IPython.html.base.zmqhandlers - Tornado handlers for WebSocket <-> ZMQ sockets.
...
IPython.utils.zmqrelated - Utilities for checking zmq versions.