问题描述:

I am trying to make a single executable out of my application that uses matplotlib using Python 2.7 and py2exe. So, I have this standard routine:

from distutils.core import setup

import zmq.libzmq

import py2exe

import glob

import matplotlib

import shutil

ico_file = "C:/Users/MyPC/Documents/newIcon.ico"

setup( windows = [{

"script":"myApp.py",

"icon_resources": [(1, ico_file)]

}],

options={

'py2exe': {

'includes':['zmq.backend.cython',

'scipy.special._ufuncs_cxx',

'scipy.linalg.cython_blas',

'scipy.linalg.cython_lapack',

'scipy.sparse.csgraph._validation'],

'excludes':['zmq.libzmq'],

'dll_excludes':['libzmq.pyd'],

'bundle_files': 2,

'compressed': True

}

},

zipfile=None,

data_files=[ ('lib', (zmq.libzmq.__file__,), ico_file) ] + matplotlib.get_py2exe_datafiles()

)

Problem Definition The created file, myApp.exe, does not run after double clicking on it (or calling from cmd). So, I used Dependency walker and I can see that zlip.pyd is missing:

LoadLibraryA("c:\users\mypc\documents\myapp\bin\dist\zlib.pyd") returned NULL. Error: The specified module could not be found (126).

Now if I change 'bundle_files': 3, I have myApp.exe running just fine, though I get a cluttered distribution directory. Any ideas about what is going wrong here?

相关阅读:
Top