我正在尝试使用Nuitka来编译一个简单的zeroMQ示例,并且遇到了问题。我使用以下命令进行编译:

nuitka --standalone --portable --remove-output --recurse-all --python-version=3.4 testclient.py


并且我收到以下编译时警告:

Nuitka:WARNING:testclient.py:1: Cannot find 'zmq' as absolute import.


当我运行exe时,运行时错误为:

ImportError: No module named 'zmq'


我是在做错什么还是nuitkazmq不兼容? (testclient.py在解释器中工作正常。)

有人可以帮助解决此问题吗? (我将其发布在这里,而不是直接通过电子邮件发送给Nuitka作者,以便其他人也可以从我的困难中学习)

使用Ubuntu 14.04和Python3.4。

编辑:使用Windows 7与Anaconda Python 3.4时遇到类似问题。

最佳答案

提取鸡蛋包,以便可以访问普通的.py文件。
您可以通过添加

[easy_install]
zip_ok = false


到您的~/.pydistutils

并重新安装依赖项。

由于某些原因,nuitka 0.5.14.3不喜欢压缩的.egg文件

关于python - Nuitka与zeroMQ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32554582/

10-14 04:00