It requires three steps to work:
- Exclude
libzmq.pydfrom dll with parameter dll_excludes. This avoids the "missing pyzmq.pyd" errors. - Exclude
zmq.libzmq(same) from modules c excludes. This skips the usual .pyd renamind and proxying that py2exe does. zmq.backend.cython includes, py2exe pyzmq. "no module named cffi", .
:
import zmq.libzmq
setup(
zipfile='lib/library.zip',
options={
'py2exe': {
'includes': ['zmq.backend.cython'],
'excludes': ['zmq.libzmq'],
'dll_excludes': ['libzmq.pyd'],
}
},
data_files=[
('lib', (zmq.libzmq.__file__,))
]
)