2

我正在尝试使用 Esky 和 ​​cx_freeze 冻结我的应用程序。

我的 setup.py 看起来像这样:

from esky.bdist_esky import Executable
from distutils.core import setup
includes = ["zmq"]
exe = Executable("main.py")

setup(
    name = "Jarvis",
    version = "0.1",
    options = {"bdist_esky" : {"includes" : includes, "freezer_module": "cxfreeze"}},
    scripts = [exe],
)

但是,似乎 pyzmq 没有正确包含在冻结中。

我不断得到:

PS C:\jarvis\dist> .\main.exe
Traceback (most recent call last):
  File "__main__.py", line 838, in <module>
  File "__main__.py", line 331, in bootstrap
  File "__main__.py", line 358, in chainload
  File "__main__.py", line 834, in _chainload
  File "main.py", line 50, in <module>
  File "main.py", line 32, in start_agent
  File "jarvis\agent\agent.pyc", line 1, in <module>
  File "zmq\__init__.pyc", line 62, in <module>
  File "zmq\backend\__init__.pyc", line 22, in <module>
  File "zmq\backend\select.pyc", line 31, in select_backend
  File "zmq\backend\cffi\__init__.pyc", line 12, in <module>
  File "zmq\backend\cffi\constants.pyc", line 4, in <module>
  File "zmq\backend\cffi\_cffi.pyc", line 18, in <module>
ImportError: No module named cffi

关于如何解决这个问题的任何想法?

EDIT2::好的,有一个答案为我解决了它>> https://bitbucket.org/anthony_tuininga/cx_freeze/issue/55/failed-with-pyzmq-1401-py33-win-amd64egg

编辑:正如建议的那样,被迫使用 cython 后端还有另一个错误堆栈跟踪:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
    exec code in m.__dict__
  File "send.py", line 5, in <module>
  File "C:\Python27\lib\site-packages\zmq\__init__.py", line 70, in <module>
    from zmq.backend import *
  File "C:\Python27\lib\site-packages\zmq\backend\__init__.py", line 23, in <mod
ule>
    _ns = select_backend(backend)
  File "C:\Python27\lib\site-packages\zmq\backend\select.py", line 31, in select
_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Python27\lib\site-packages\zmq\backend\cython\__init__.py", line 26,
in <module>
    from . import (constants, error, message, context,
  File "ExtensionLoader_zmq_backend_cython_error.py", line 22, in <module>
  File "ExtensionLoader_zmq_backend_cython_error.py", line 14, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.

我猜加载本机存在问题libzmq.dll(但是,zmq.libzmq.pyd结果dist文件夹中有一些),有人解决了这个问题吗?

4

0 回答 0