From: jenny <je...@gm...> - 2006-08-24 20:11:41
|
Hi Charlie, Jenny here. I'm trying to make an executable of my python program that uses MatPlotLib. I tried your example below and I got this kind of error when I ran the exe. I'm using python 2.3.3, MatPlotLib 0.87.3 and py2exe 0.6.5. I really need to use the MatPlotLib don't know what to do. Thanks, Jenny ----Error------------------------------------------------------------------= -------------------------------------------------------------- Traceback (most recent call last): File "simple_plot.py", line 1, in ? File "pylab.pyo", line 1, in ? File "matplotlib\pylab.pyo", line 219, in ? File "matplotlib\backends\__init__.pyo", line 23, in pylab_setup ImportError: No module named backend_tkagg Charlie Moad wrote: >=20 > A feature I mentioned on the list a few weeks ago is in the 0.87 > release that was pushed today. It is > "matplotlib.get_py2exe_datafiles()". You can see it used in the > sample setup.py script below. >=20 > Begin setup.py script > -------------------------------------------------------------------------= ------------- > # For py2exe only > """ > Run with the following command (use py2exe 0.6.2 or higher) >=20 > python.exe -OO setup.py py2exe -b 3 -c -p numarray,pytz -e numpy > """ >=20 > import os > from distutils.core import setup > import py2exe > import glob >=20 > import matplotlib >=20 > setup( version =3D '0.9.1', > windows =3D ['nlogui.py'], > data_files =3D [('', ['nlo.gif', '../vtkrotate/NMA.pdb']), > matplotlib.get_py2exe_datafiles()], > options=3D{"py2exe":{"optimize":2}}, > ) >=20 >=20 > On 2/22/06, Jeff Peery <jef...@ya...> wrote: >> Hi, I'm pretty unfamiliar with py2exe and I had been using it with >> matplotlib and it was working well. I upgraded to 0.86 and now it doesn'= t >> work. I know this is because the installation directory is different (no >> longer the share folder). I thought I fixed it correctly but I get an >> error >> that indicates py2exe "can't find >> lib/site-packages/matplotlib/backends or it is not a >> regular file". I am assuming that it doesn't like 'backends' because it >> is >> a folder and not a file. I changed my setup code to this: >> >> data_files=3D[ >> ("matplotlibdata", >> glob.glob(os.path.join(distutils.sysconfig.PREFIX, >> 'lib', 'site-packages','matplotlib', "*")))] >> >> setup( >> options =3D options, >> # The lib directory contains everything except the executab les and >> the >> python dll. >> windows =3D [app], >> data_files =3D data_files, >> # use out build_installer class as extended py2exe build command >> cmdclass =3D {"py2exe": build_installer}, >> ) >> >> how might I change this to get it working properly? thanks!! >> >> Jeff >> >> >> ________________________________ >> Brings words and photos together (easily) with >> PhotoMail - it's free and works with Yahoo! Mail. >> >> >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >=20 >=20 --=20 View this message in context: http://www.nabble.com/py2exe-setup-script-tf1= 172593.html#a5935932 Sent from the matplotlib - users forum at Nabble.com. |