无法为Python的安装PyZMP - 依赖(Can't install PyZMP fo

2019-10-19 18:04发布

我在安装了IPython中的PyZMP依赖麻烦。 我已经尝试了一些东西,如使用PIP / BREW,但最终手动安装包使用这个答案 。

现在, pip list packages产生以下

pyzmq (14.2.0-dev)
pyzmq-static (2.2)

(我还用pyzmq静态试过)。

另外,我的蟒蛇蛋是在正确的位置清晰地呈现:

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

任何帮助排除故障将非常apprecaited!

更新:我能列出蟒蛇的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.

Answer 1:

您必须使用:

import zmq

代替

import pyzmq

看看官方的例子在https://github.com/zeromq/pyzmq/blob/master/examples/



Answer 2:

我也挣扎越来越安装的IPython(Jupyter),尤其是与pyzmq依赖。 最后,我发现,用少得多的麻烦为我工作(在Ubuntu)的方法:

$ sudo apt-get install libtool pkg-config build-essential autoconf automake python-dev 
$ sudo apt-get build-dep matplotlib 
$ sudo pip install matplotlib 
$ sudo pip install "ipython[all]"


文章来源: Can't install PyZMP for Python — Dependencies