0

我正在尝试安装 pyzmq 以在 qtconsole 模式下获取 ipython wotking。

我已经在默认位置(/usr/local)安装了 zeromq。动态库和标题都在正确的位置。

我为 pyzmq 克隆了 git repo 并运行配置命令:

[root@XXXXX pyzmq]# python setup.py configure --zmq=/usr/local
running configure
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:       /usr/local
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
gcc -pthread detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/vers
ZMQ version detected: 2.2.0
************************************************

到目前为止,一切都很好。然后我运行安装命令:

[root@XXXXXX pyzmq]# python setup.py install
 running install
running build
running build_py
running build_ext
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:       /usr/local
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/local/include -Izmq/utils -Izmq/core -Izmq/devices -c detect/vers.c -o detect/vers.o
gcc -pthread detect/vers.o -L/usr/local/lib -Wl,-R/usr/local/lib -lzmq -o detect/vers
    ZMQ version detected: 2.2.0
************************************************
skipping 'zmq/core/_poll.c' Cython extension (up-to-date)
skipping 'zmq/core/_version.c' Cython extension (up-to-date)
skipping 'zmq/core/constants.c' Cython extension (up-to-date)
skipping 'zmq/core/context.c' Cython extension (up-to-date)
skipping 'zmq/core/device.c' Cython extension (up-to-date)
skipping 'zmq/core/error.c' Cython extension (up-to-date)
skipping 'zmq/core/message.c' Cython extension (up-to-date)
skipping 'zmq/core/socket.c' Cython extension (up-to-date)
skipping 'zmq/core/stopwatch.c' Cython extension (up-to-date)
skipping 'zmq/utils/initthreads.c' Cython extension (up-to-date)
skipping 'zmq/utils/rebuffer.c' Cython extension (up-to-date)
skipping 'zmq/devices/monitoredqueue.c' Cython extension (up-to-date)
running install_lib
running install_egg_info
Writing /usr/lib64/python2.7/site-packages/pyzmq-2.2dev-py2.7.egg-info

然后我尝试在 python 中加载模块:

>>> import zmq

这有效(在 setup.py 命令中添加了 --inplace 之后)

但是当我启动 ipython qtconsole 时,我得到了这个错误(在其他几行之后):

import zmq
 File "/usr/lib64/python2.7/site-packages/zmq/__init__.py", line 29, in <module>
    from zmq import core, devices
  File "/usr/lib64/python2.7/site-packages/zmq/core/__init__.py", line 26, in <module>
    from zmq.core import (constants, error, message, context,
  File "message.pxd", line 39, in init zmq.core.poll (zmq/core/poll.c:2950)
ValueError: zmq.core.message.Message has the wrong size, try recompiling

知道这可能来自哪里吗?

4

1 回答 1

0

@akira - 可能是您从他们的 github 存储库中签出标签(v2.2.0)。我这样做也看到了同样的问题。然后我从 pypi 下载了 v2.2.0 的 tar.gz,它运行良好。

于 2012-07-10T09:45:31.513 回答