Giovanni Bajo wrote:
> On 2/15/2007 8:18 PM, Artie wrote:
>
> >>>>> On Feb 6, 8:23 am, "Artie" <[EMAIL PROTECTED]> wrote:
> >>>>>> I'm back with another issue that I couldn't resolve :-) !  I'm not
> >>>>>> trying to annoy... really... I'm not.
> >>>>>> In my python script:
> >>>>>> import encodings
> >>>>>> from encodings import *
> >>>>>> import encodings.cp1252
> >>>>>> import encodings.idna
> >>>>>> import encodings.hex_codec
> >>>>>> import encodings.latin_1
> >>>>>> import encodings.utf_8
> >>>>>> import encodings.utf_16
> >>>>>> import encodings.utf_16_le
> >>>>>> import encodings.ascii
> >>>>>> After built with pyinstaller (svn rev 306), I run my program and
> >>>>>> receive the error:
> >>>>>> Traceback (most recent call last):
> >>>>>>   File "<string>", line 3, in ?
> >>>>>>   File "/home/ueoff/Desktop/pyinstaller/iu.py", line 334, in
> >>>>>> importHook
> >>>>>>     raise ImportError, "No module named %s" % fqname
> >>>>>> ImportError: No module named encodings
> >>>>>> Any suggestions?
> >>>>>> --Artie
> >>>>> This is the only warning about encodings generated during build:
> >>>>> W: delayed  __import__ hack detected at line 0 - encodings (/usr/lib64/
> >>>>> python2.4/encodings/__init__.pyo)
> >>>> I have the same problem, with (and only with) OpenGL.
> >>>> If I do not use encodings then it can't find another module.
> >>>> When I don't use OpenGL it is just fine, so I think it has something
> >>>> to do with OpenGL.
> >>>> If anyone can help us with this, please.
> >>>> Sorry, English is not my native language.- Hide quoted text -
> >>>> - Show quoted text -
> >>> I am using PyOpenGL as well...
> >> Hi Artie, again sorry for my bad English.> I am using PyOpenGL as well...
> >>
> >> Yes, me to.
> >> I am not sure, but I think that PyOpenGL use Python C/API to do the
> >> import and pyinstaller can't detect everything. So we need some kind
> >> of hooks.
> >> I use pyinstaller for a long time and never had any problems till now.
> >> And only difference was PyOpenGL.
> >> Try to build a simple script, let's say:
> >> #! /usr/bin/python
> >>
> >> print "Hi, all"           # just for fun
> >>
> >> then try same script with PyOpenGL:
> >> #! /usr/bin/python
> >> from OpenGL.GL import *
> >> print "Hi, all"           # just for fun
> >>
> >> I can't really try that now, because I not at home, but I think it
> >> will generate same (or similar) error.
> >> In my project when I comment lines starting with:
> >> from OpenGL.GL import *
> >> from OpenGL.GLU import *
> >> from OpenGL.GLUT import *
> >> everythink is just fine.
> >>
> >> I don't know, should we file a bug report or something.
> >
> > Well, I think this thread is the bug report...  The maintainers of
> > pyinstaller seem to regularly respond to these threads; and hopefully
> > they will soon.  I know that there is a way for these types of
> > installers to deal with these kinds of issues; py2app, py2exe, and
> > cx_Freeze don't have any problems doing it.  And you might ask... "why
> > not use those instead?".  Well I do, but their options are limited and
> > require a little more setup on your end.  That is why I am evaluating
> > pyinstaller and I think it has some potential... and hopefully using
> > PyOpenGL in your project does not render pyinstaller useless in the
> > future.  But, until then, it is useless to me.
>
> Hello,
>
> I had a look at the thread. I can't really help if you don't give me a
> reproducible test case. Try finding a minimal program which doesn't work
> with PyInstaller and send it to me.
>
> BTW, PyOpenGL usually works well with PyInstaller, I have personally
> packaged large applications with PyOpenGL without any problem.
> --
> Giovanni Bajo

Hi Giovanni,

I am using PyInstaller 1.3 and 1.2. Linux, PyOpenGL version 2.0.2.01.
Here is simple script:
####################
#! /usr/bin/python
import os
from OpenGL.GL import *

print "Hello"
###################

here is a spec file generated by Makespec.py
##################
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
os.path.join(HOMEPATH,'support/useUnicode.py'), 't/t.py'],
             pathex=['/home/srx/Python/pyinstaller-1.3'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts+ [('v', '', 'OPTION')],
          exclude_binaries=1,
          name='buildt/t',
          debug=False,
          strip=False,
          upx=False,
          console=1 )
coll = COLLECT( exe,
               a.binaries,
               strip=False,
               upx=False,
               name='distt')

##################

and warning file
#################
W: no module named dotblas (top-level import by Numeric)
W: no module named OpenGL.GLU.gluPickMatrix (delayed import by
OpenGL.GL.GL__init__)
W: no module named org (top-level import by pickle)
W: no module named org (top-level import by copy)
W: no module named _emx_link (conditional import by os)
W: no module named Carbon (conditional import by tempfile)
W: delayed conditional __import__ hack detected at line 0 - doctest (/
usr/lib/python2.4/doctest.pyc)
W: delayed  exec statement detected at line 0 - doctest (/usr/lib/
python2.4/doctest.pyc)
W: delayed  exec statement detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: delayed conditional eval hack detected at line 0 - Numeric (/usr/
lib/python2.4/site-packages/Numeric/Numeric.pyc)
W: __all__ is built strangely at line 0 - dis (/usr/lib/python2.4/
dis.pyc)
W: delayed  __import__ hack detected at line 0 - encodings (/usr/lib/
python2.4/encodings/__init__.pyc)
W: __all__ is built strangely at line 0 - re (/usr/lib/python2.4/
re.pyc)
W: delayed  eval hack detected at line 0 - os (/usr/lib/python2.4/
os.pyc)
W: __all__ is built strangely at line 0 - __future__ (/usr/lib/
python2.4/__future__.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: __all__ is built strangely at line 0 - tokenize (/usr/lib/python2.4/
tokenize.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
srx/Python/pyinstaller-1.3/iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
srx/Python/pyinstaller-1.3/iu.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (/usr/lib/
python2.4/pickle.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (/usr/lib/
python2.4/pickle.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (/usr/
lib/python2.4/warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (/
usr/lib/python2.4/warnings.pyc)
W: delayed  exec statement detected at line 0 - bdb (/usr/lib/
python2.4/bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)

#################
and when I try to run a binary:
################
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import marshal # builtin
import imp # builtin
import posix # builtin
dlopen("./struct.so", 2);
import struct # dynamically loaded from ./struct.so
Traceback (most recent call last):
  File "<string>", line 3, in ?
  File "/home/srx/Python/pyinstaller-1.3/iu.py", line 334, in
importHook
    raise ImportError, "No module named %s" % fqname
ImportError: No module named encodings
################

If I don't use encodings, Makespec.py -a option, or edit spec file to
look like this:
###############
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), 't/
t.py'],
             pathex=['/home/srx/Python/pyinstaller-1.3'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts+ [('v', '', 'OPTION')],
          exclude_binaries=1,
          name='buildt/t',
          debug=False,
          strip=False,
          upx=False,
          console=1 )
coll = COLLECT( exe,
               a.binaries,
               strip=False,
               upx=False,
               name='distt')

###############
warning file:
##############
W: no module named dotblas (top-level import by Numeric)
W: no module named OpenGL.GLU.gluPickMatrix (delayed import by
OpenGL.GL.GL__init__)
W: no module named org (top-level import by pickle)
W: no module named org (top-level import by copy)
W: no module named _emx_link (conditional import by os)
W: no module named Carbon (conditional import by tempfile)
W: delayed conditional eval hack detected at line 0 - Numeric (/usr/
lib/python2.4/site-packages/Numeric/Numeric.pyc)
W: __all__ is built strangely at line 0 - dis (/usr/lib/python2.4/
dis.pyc)
W: delayed  exec statement detected at line 0 - bdb (/usr/lib/
python2.4/bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)
W: delayed  eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)
W: __all__ is built strangely at line 0 - re (/usr/lib/python2.4/
re.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (/
usr/lib/python2.4/doctest.pyc)
W: delayed  exec statement detected at line 0 - doctest (/usr/lib/
python2.4/doctest.pyc)
W: delayed  eval hack detected at line 0 - os (/usr/lib/python2.4/
os.pyc)
W: delayed  exec statement detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed  eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: __all__ is built strangely at line 0 - __future__ (/usr/lib/
python2.4/__future__.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: __all__ is built strangely at line 0 - tokenize (/usr/lib/python2.4/
tokenize.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (/usr/lib/
python2.4/pickle.pyc)
W: delayed  __import__ hack detected at line 0 - pickle (/usr/lib/
python2.4/pickle.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
srx/Python/pyinstaller-1.3/iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
srx/Python/pyinstaller-1.3/iu.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (/usr/
lib/python2.4/warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (/
usr/lib/python2.4/warnings.pyc)

##################

and when I run a binary:
#################
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import marshal # builtin
import imp # builtin
import posix # builtin
dlopen("./struct.so", 2);
import struct # dynamically loaded from ./struct.so
Traceback (most recent call last):
  File "<string>", line 2, in ?
  File "/home/srx/Python/pyinstaller-1.3/iu.py", line 334, in
importHook
    raise ImportError, "No module named %s" % fqname
ImportError: No module named os
#################

And if I comment line
from OpenGL.GL import *
I will get:
############
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
import marshal # builtin
import imp # builtin
import posix # builtin
dlopen("./struct.so", 2);
import struct # dynamically loaded from ./struct.so
dlopen("./zlib.so", 2);
import zlib # dynamically loaded from ./zlib.so
import _codecs # builtin
Hello
#############

I hope this will help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to