[英]Why I can't import pyzmq on ubuntu 14.04 LTS?
I have installed zmq and pyzmq.But I can't import pyzmq. 我已经安装了zmq和pyzmq,但是无法导入pyzmq。
>>> Successfully installed pyzmq
Cleaning up...
hepeng@hp:~$ python
enter code here
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyzmq
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pyzmq
But I can import zmq. 但是我可以导入zmq。
>>> import zmq
>>>
So why?Thanks. 那为什么呢?
pyzmq
is the PyPI package installer name, but the actual root package is named and imported as zmq
. pyzmq
是PyPI软件包安装程序的名称,但实际的根软件包已命名并导入为zmq
。 This is just how some Python packages work; 这就是某些Python软件包的工作方式。 PyYAML
is another example, being installed under the name PyYAML
, but imported as yaml
. PyYAML
是另一个示例,以名称PyYAML
进行安装,但以yaml
导入。
If you take a look at the zmq
docs or pyzmq
API , you'll notice all the Python examples import
as zmq
. 如果你看看在zmq
文档或pyzmq
API ,你会发现所有的Python示例import
为zmq
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.