From: Davidmh <dav...@gm...> - 2010-05-12 18:11:46
|
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? Thank you; David Menéndez. |
From: Stef M. <ste...@gm...> - 2010-05-12 18:41:27
|
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 > |
From: Davidmh <dav...@gm...> - 2010-05-12 18:43:59
|
Where? In the setup for py2exe or in the original source code? 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 |
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 >>>> >> >> > |
From: Guy K. K. <g....@ma...> - 2010-06-09 23:35:59
|
On Thu, 10 Jun 2010 04:11:56 Davidmh wrote: > try: from visual import * > except:pass Can you please at least try to capture a *specific* exception? Harvesting off *all* exceptions is usually a *very* bad design decision, and much frowned upon. If there's a problem, take a note of the exception, and then use precisely that one in the try/except block. I know there are quite some programming newbies also here on the list, and I do not like to leave these sloppy code samples around here to be adopted (and worsened in the course). Thanks, Guy PS: Also try to cut the quoted mails to what is necessary to understand your mail in context, and do not leave all the crap with all signatures underneath your mail. This is especially nice to people reading to the mailing list in digest mode! -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Pūtaiao o Mōhiohio me Pāngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9266 fax: +64 9 441-8181 G....@ma... http://www.massey.ac.nz/~gkloss |
From: Daπid <dav...@gm...> - 2010-07-21 00:28:48
|
Hello. On Wed, Jun 9, 2010 at 6:11 PM, Davidmh <dav...@gm...> wrote: > 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. In some new scritps, when I compile them with py2exe, I get: Traceback (most recent call last): File "show_scene.py", line 5, in <module> NameError: name 'display' is not defined Of course, the original .py script, before Py2exe works great without raising errors. The five first lines, until the crash are: 1· try: from visual import * 2· except IOError: pass 3· 4· 5· scene=display() Trying to figure how to solve it, I remembered some VPython scripts I compiled some months ago, that were functional; but when I try to run them, I get similar errors. In this same computer, they ran perfectly time ago. I don't remember doing any big modification in the OS (appart from the security updates), nor touching the Python installation (although this should work anyway). More testing brings more weird results. Testing both old and new scripts in another similar computer, the old one works great (as it should), but the new one still says the same error. Anyone has any idea on why is it happening and how to solve? Thank you very much. David. P.D.: if anyone needs the complete scritps, just ask for them; I don't have any problem in publishing them. |