From: Davidmh <dav...@gm...> - 2010-06-09 16:12:27
|
Hello. I have finally fixed the problem in a somewhat silly way: try: from visual import * except:pass I figure the crash is before the important parts of visual are imported, so it can go ahead. It won't work on programs that depend on materials. Regards, David. On Wed, May 12, 2010 at 10:23 PM, Davidmh <dav...@gm...> wrote: > I have found this: http://www.py2exe.org/index.cgi/MatPlotLib > > That, in my case turns into: > > data_files = [( r'visual', glob.glob > (r'C:\Python25\Lib\site-packages\visual\*.tga' )), > > (r'visual',[r'C:\Python25\Lib\site-packages\visual\turbulence3.tga'])], > > But the problem persists. Instead of storing it in > dist/library.zip/visual, it creates a new directory, putting the files > in dist/visual > > > Doing some research I have arrived to: > > opts = { > 'py2exe': { 'packages': ['visual'] > } > } > > Here I can override the turbulence3.tga crash, but I get > > Traceback (most recent call last): > File "selfoc.py", line 2, in <module> > File "visual\__init__.pyc", line 83, in <module> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xd3 in position 49: ordinal > not in range(128) > > whenever I try to execute it. > > > What am I doing wrong? > > Thanks a lot. > > David. > > On Wed, May 12, 2010 at 8:51 PM, Stef Mientki <ste...@gm...> wrote: >> On 12-05-2010 20:43, Davidmh wrote: >>> Where? In the setup for py2exe or in the original source code? >>> >> the Datafiles of py2exe, >> don't know how to that anymore, but that's in the docs of py2exe. >> >> As Py2exe is a crime to work with, >> not only for vpython, but also matplotlib and others, >> I made a setup program once and use it all the time with great success. >> >> cheers, >> Stef >> >> >>> Thanks for your help. >>> >>> On Wed, May 12, 2010 at 8:41 PM, Stef Mientki <ste...@gm...> wrote: >>> >>>> On 12-05-2010 18:04, Davidmh wrote: >>>> >>>>> Hello. >>>>> >>>>> I have compiled successfully several programs to Windows binaries usin >>>>> py2exe, but when I try to execute a working program depending on >>>>> VPython, I get the following error: >>>>> >>>>> Traceback (most recent call last): >>>>> File "mirage.py", line 2, in <module> >>>>> File "visual\__init__.pyc", line 66, in <module> >>>>> File "visual\ui.pyc", line 3, in <module> >>>>> File "visual\materials.pyc", line 151, in <module> >>>>> File "visual\materials.pyc", line 129, in loadTGA >>>>> IOError: [Errno 2] No such file or directory: >>>>> 'C:\\pyex\\dist\\library.zip\\visual/turbulence3.tga' >>>>> >>>>> I use Python 2.5, and as I have seen, there have been more people with >>>>> the same problem. The only solution reported I have found is simply >>>>> deleting the definition on the module source code. Although inelegant, >>>>> it could work, as long I am not using any materials in my program; but >>>>> I don't like editing that kind of source. >>>>> >>>>> I think the option "excludes" could be used, but after several tries I >>>>> haven't been successful. >>>>> >>>>> Any ideas? >>>>> >>>>> >>>>> >>>> I always include all the tga files explicitly: >>>> if Include_VPython : >>>> Data_Files.append ( ( r'visual', glob.glob ( >>>> r'P:\Python\Lib\site-packages\visual\*.tga' ))) >>>> chers, >>>> Stef >>>> >>>>> Thank you; >>>>> >>>>> David Menéndez. >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Visualpython-users mailing list >>>>> Vis...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/visualpython-users >>>>> >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Visualpython-users mailing list >>>> Vis...@li... >>>> https://lists.sourceforge.net/lists/listinfo/visualpython-users >>>> >> >> > |