> Traceback (most recent call last):
> File "<string>", line 3, in <module>
> File "/home/lvoinea/pyinstall/pyinstaller-1.3/iu.py", line 334, in
> importHook
> raise ImportError, "No module named %s" % fqname
> ImportError: No module named encodings
>
> Does anyone have a solution/advice on this?
Is the encoding module available on your system at all (it should)? Try
python "import encodings" using the normal python interpreter.
If yes: Is the encodings module contained in the exe/dir? Use
ArchiveView to look inside the .PYZ (I expect no)
So find out which of the modules import encodings and implement hook
for it.
--
Schönen Gruß - Regards
Hartmut Goebel
Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de
On 8/15/08, Lucian wrote:
> Including the .pyc files in the application folder does not solve the
> problem for me.
>
> After some experiments and digging in the code of iu.py I came with
> the following conclusions:
>
> - PyInstaller does not support PyOpenGL from version 3.0.0 on. In
> this version PyOPpenGL starts to use pkg_resources intenally, and
> PyInstaller does not have support for this (http://www.mail-
> archive.com/pyins...@googlegroups.com/msg00257.html). One may try
> to use an older version of PyOpenGL (e.g, 2.0.1.09).
>
> - I could not find a working distribution of version 2.0.1.09 (of
> earlier) of PyOpenGL for Python 2.5.2. The only one I found with
> support for Python 2.5 is python_opengl_2.0.1.09.dsg.1-0.3_i386.deb.
> However, this contains a bug that prevents it from working on Python
> 2.5.2 (and 2.5.1 ?). This bug is marked as solved in version 3.0.0 of
> PyOpenGL.
I don't use PyInstaller, so I am not sure the same workaround can
apply here. I stumbled upon the same problem with py2exe, which does
not support eggs file and friends, and I solved the issue by adding
these lines of code at the beginning of my application code:
pyOpenglName = "PyOpenGL-3.0.0b3-py2.5.egg"
setupToolsName = "setuptools-0.6c8-py2.5.egg"
if hasattr(sys, "frozen"):
if pyOpenglName not in sys.path:
sys.path.insert(0, os.path.join(sys.prefix, pyOpenglName))
if setupToolsName not in sys.path:
sys.path.insert(0, os.path.join(sys.prefix, setupToolsName))
By manually adding the eggs file in the distribution folder my app
runs happily also in executable mode.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
> By manually adding the eggs file in the distribution folder my app
> runs happily also in executable mode.
PyInstaller trunk supports zipimport.
Since I have no write access to the Wiki, I can not document it there :-(
Adding zipimport is easy: Just add 'support/_pyi_egg_extract.py' to the
Analyse() part of your .spec file, like this:
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
os.path.join(HOMEPATH,'support/useUnicode.py'),
os.path.join(HOMEPATH,'support/_pyi_egg_extract.py'),
__testname__ + '.py'],
)