I think it has to do with the texture path definition in the materials.py module of the Visual Python.
Long time ago, I had tested py2exe and had the same problem. Then tested other exe builders. Same again. They look for a visual subdirectory under current distribution directory.
The last one I had tested was pyinstaller-1.3. Again with the same problem. I am using pyinstaller at the moment, but I believe same "solutions" apply for all. I have not tested with py2exe again.
In the materials.py file change the texturePath definition for the targa texture files to a static one. At the moment it is the dynamic path address resolution, which creates the problem. For simplicity I use "C:\" as the texture path. But now, the Visual will be looking for three targa files at C:\. So, you have to copy earth.tga, turbulence3.tga, and the wood.tga files to C:\ before you start creating the exe.
UP SIDE: Your old Visual Python application works normally as they used to (which normally you would expect of course).
DOWN SIDE: If you are going to distribute the exe file or the full new directory to other machines without the Visual, you need to copy these three files manually to C:\ at the target machines ALSO.
I could not find any better solution.
Kadir Haldenbilen
________________________________
From: Derek Lura <dl...@ma...>
To: vis...@li...
Sent: Friday, July 24, 2009 11:14:53 AM
Subject: [Visualpython-users] Error using py2exe with Vpython
I get the following error when I try to run a visual program compiled
with py2exe
Traceback (most recent call last):
File "controls2.py", line 7, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "visual\__init__.pyo", line 66, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "visual\ui.pyo", line 3, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "visual\materials.pyo", line 151, in <module>
File "visual\materials.pyo", line 129, in loadTGA
IOError: [Errno 2] No such file or directory: "C:\\Documents and
Settings\\D-man\\Desktop\\Research\\'09\\Forign
Study\\Python\\CopyforComp\\Done\\dist\\controls2.exe\\visual/turbulence3.tga"
Has anyone encountered this before? Anyone have a possible solution?
Thanks,
- Derek
------------------------------------------------------------------------------
_______________________________________________
Visualpython-users mailing list
Vis...@li...
https://lists.sourceforge.net/lists/listinfo/visualpython-users
|