From: andres f. s. e. <lor...@ho...> - 2008-04-30 03:40:59
|
I am making an application in python with libraries vpython and numpy , and CREATE an . Exe with py2exe but I had difficulties.Adding to both libraries to the setup.py required by py2exe, but I stillappearing messages like: Traceback (most recent call last): File '3_5.py', line 2, in <module> File 'datos_de_programa\datos_de_simulacion\maquina_simulacion.pyc', line 15, in <module> File 'visual\__init__.pyc', line 24, in <module> ImportError: No module named crayola I have heard that there is a problemnumpy with vpython because it uses a library called vpython Numeric andthe numpy is substituting, then pollution causes a name or something.Does anyone could fingers as I can generate an executable program ofpython made with py2exe work with numpy and vpython together? This is the file setup.py: from distutils.core import setup import py2exe # We need to import the glob module to search for all files. import glob # We need to exclude matplotlib backends not being used by this executable. You may find # that you need different excludes to create a working executable with your chosen backend. # We also need to include include various numerix libraries that the other functions call. opts = { 'py2exe': { 'includes' : [ 'matplotlib.backends', 'matplotlib.backends.backend_wxagg', 'matplotlib.backends.backend_wx','pylab', 'matplotlib.numerix.fft', 'matplotlib.numerix.linear_algebra','matplotlib.numerix.random_array', 'matplotlib.figure','wx.build','wx.lib','wx.py','wx.tools','wx.animate','wx.aui', 'wx.calendar','wx.combo','wx.grid','wx.html','wx.media','wx.richtext','wx.webkit', 'wx.wizard','wx.xrc','wx.gizmos','wx.glcanvas','wx.activex','wx.stc', 'scipy.linalg'], #,'numpy'], 'excludes': ['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg', '_fltkagg', '_gtk', '_gtkcairo', 'Tkconstants','Tkinter','tcl'], 'dll_excludes': ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll'], 'packages':['plantas','numarray'], } } # Save matplotlib-data to mpl-data ( It is located in the matplotlib\mpl-data # folder and the compiled programs will look for it in \mpl-data # note: using matplotlib.get_mpldata_info data_files = [(r'mpl-data', glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\*.*')), # Because matplotlibrc does not have an extension, glob does not find it (at least I think that's why) # So add it manually here: (r'mpl-data', [r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\matplotlibrc']), (r'mpl-data\images',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\images\*.*')), (r'mpl-data\fonts',glob.glob(r'C:\Python25\Lib\site-packages\matplotlib\mpl-data\fonts\*.*')), ( r'',glob.glob(r'C:\Documents and Settings\Angelical\Escritorio\datos_de_programa\pylab2.png')), ( r'',glob.glob(r'C:\Documents and Settings\Angelical\Escritorio\datos_de_programa\pylab2.ico')), ( r'ayuda',glob.glob(r'C:\Documents and Settings\Angelical\Escritorio\datos_de_programa\ayuda\*.*')), ( r'plantas',glob.glob(r'C:\Documents and Settings\Angelical\Escritorio\plantas\*.*'))] # for console program use 'console = [{'script' : 'script.py'}] setup(windows=[{'script' : '3_5.py','icon_resources': [(1,'datos_de_programa\pylab.ico')]}], options=opts, data_files=data_files) #setup(console = [{'script' : '3_5.py'}],options=opts, data_files=data_files) _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx |