Executable only running on Build computer

42 views
Skip to first unread message

Kel Solaar

unread,
Oct 6, 2008, 6:51:56 PM10/6/08
to PyInstaller
Hello,

I builded a PyQt Application on computer running Xubuntu, it's working
fine on it but when I'm trying to start it on another I'm getting this
error message :

Traceback (most recent call last):
File "<string>", line 42, in <module>
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 407, in
importHook
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 465, in
doimport
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 276, in
getmod
File "/home/ksolaar/Softwares/pyinstaller/archive.py", line 418, in
getmod
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 102, in
getmod
ImportError: libQtCore.so.4: cannot open shared object file: No such
file or directory

Sounds like there is a library missing, so I commented the regex in
bindepend.py so that /usr/lib and /lib are included, this time the
libraries are sent to the distribution folder (I find the libQtCore.so.
4) but the error is still the same :

ImportError: libQtCore.so.4: cannot open shared object file: No such
file or directory

I decided to install PyQt4, QT4 and all the same stuff I have on the
build computer but this time I'm encountering this error message :

Traceback (most recent call last):
File "<string>", line 42, in <module>
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 407, in
importHook
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 465, in
doimport
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 276, in
getmod
File "/home/ksolaar/Softwares/pyinstaller/archive.py", line 418, in
getmod
File "/home/ksolaar/Softwares/pyinstaller/iu.py", line 102, in
getmod
ImportError: ./PyQt4.QtCore.so: undefined symbol:
_ZN24QXmlStreamEntityResolver13resolveEntityERK7QStringS2

Anyone has an idea of what's happening ?

Thanks,

Thomas

Hartmut Goebel

unread,
Oct 6, 2008, 7:34:50 PM10/6/08
to PyIns...@googlegroups.com
Kel Solaar schrieb:

> Sounds like there is a library missing, so I commented the regex in
> bindepend.py so that /usr/lib and /lib are included, this time the
> libraries are sent to the distribution folder (I find the libQtCore.so.
> 4) but the error is still the same :

Use ArchiveViewer.py to see whether it is put into the archive.
Otherwise try copying this file onto the target computer, too.

> ImportError: ./PyQt4.QtCore.so: undefined symbol:
> _ZN24QXmlStreamEntityResolver13resolveEntityERK7QStringS2
>
> Anyone has an idea of what's happening ?

This is a typical error is library versions do not match _exactly_. This
_ZN... stuff is some build-date identifier which is put around the
symbol names. So you need the same version on both computers. Try to fix
the other problem, it's much more helpful :-)

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Kel Solaar

unread,
Oct 7, 2008, 7:55:36 AM10/7/08
to PyInstaller
I checked the PyQt versions on both computers and yeah it's not
exactly the same version of PyQt that is installed. That certainly
explain the "undefined symbol:
_ZN24QXmlStreamEntityResolver13resolveEntityERK7QStringS2" error, I
currently didnt manage to get the same version installed with synaptic
installer (one computer is on a xubuntu 8.04 with XFCE and the other
on ubuntu 8.04 with Gnome and for both of them the PyQT version
installed is the last updtodate one whereas they are different :| ).
That lead me to the current problem : if I uncomment the regex
exclusions, I find the missing module in the distribution module
(pyInstaller copy them) but when you start the builded executable it
looks like it dont check in it's own folder to search for libraries at
all (I'm getting the "ImportError: libQtCore.so.4: cannot open shared
object file: No such
file or directory" error ). This is really problematic because that
mean the builded executable has little chances to find the same
library version than the one used to compile it. Is there a way to
force PyInstaller/Builded Executable to use the distribution folders
libraries ?
>  smime.p7s
> 6KAfficherTélécharger

Kel Solaar

unread,
Oct 7, 2008, 9:49:37 AM10/7/08
to PyInstaller
I do it more clear (I hope) for my current problem : It's like the
Builded application is ignoring the modules that are present in it's
dist folder, libQtCore.so.4 is ignored that's for sure (I commented
the regex exclusions in binddepend.py so that the libQtCore.so.4 is
included in the dist folder by PyInstaller ). The problem now is that
I can't really tell to Install PyQT 4 because if the version mismatch
with the one used for the compilation I have "undefined symbol" error.
That's it, hope it's better like that :]

Hartmut Goebel

unread,
Oct 7, 2008, 10:27:01 AM10/7/08
to PyIns...@googlegroups.com
Kel Solaar schrieb:

> I do it more clear (I hope) for my current problem : It's like the
> Builded application is ignoring the modules that are present in it's
> dist folder, libQtCore.so.4 is ignored that's for sure (I commented

put this at the very beginning of your script:

import os
print os.environ['LD_LIBRARY_PATH']
print os.environ['_MEIPASS2']

Post the result here.

Kel Solaar

unread,
Oct 7, 2008, 10:37:44 AM10/7/08
to PyInstaller
Hi Harmut o/

Thanks for your help, I'm at work and don't have the code here, I'll
do that tonigth as soon as I get back at home.

Thomas

Kel Solaar

unread,
Oct 7, 2008, 3:40:03 PM10/7/08
to PyInstaller
Hi Harmut,

Here is the log (I didnt managed to paste/post it here):

http://kelsolaar.hdrlabs.com/sIBL_Framework/sIBL_GUI/Others/sIBL_GUI%20-%20Log_01.txt

'LD_LIBRARY_PATH' and '_MEIPASS2' keys are missing from os.environ :|

Hartmut Goebel

unread,
Oct 7, 2008, 4:22:12 PM10/7/08
to PyIns...@googlegroups.com
Kel Solaar schrieb:

> 'LD_LIBRARY_PATH' and '_MEIPASS2' keys are missing from os.environ :|

??? This is very, very wierd!

Have you checked the tipps at
<http://pyinstaller.hpcf.upr.edu/docs/Manual_v1.1.html#when-things-go-wrong>?

What is your spec-file?

What are your command lines for building the executable?
What is your command line for running the executable?

Kel Solaar

unread,
Oct 7, 2008, 5:41:18 PM10/7/08
to PyInstaller
Hi,

here is the warnsIBL_GUI.txt file content :

W: no module named win32api (delayed import by platform)
W: no module named win32com (conditional import by __main__)
W: no module named win32pipe (delayed, conditional import by platform)
W: no module named MacOS (delayed import by platform)
W: no module named optik.__all__ (top-level import by optparse)
W: no module named java (delayed import by platform)
W: no module named PyQt4._qt (top-level import by PyQt4.QtGui)
W: no module named vms_lib (delayed, conditional import by platform)
W: no module named PyQt4._qt (top-level import by PyQt4.QtCore)
W: no module named win32con (delayed import by platform)
W: no module named gestalt (delayed import by platform)
W: no module named org (top-level import by copy)
W: no module named _emx_link (conditional import by os)
W: no module named optik.__version__ (top-level import by optparse)
W: no module named Carbon (conditional import by tempfile)
W: delayed __import__ hack detected at line 0 - encodings (/usr/lib/
python2.5/encodings/__init__.pyc)
W: __all__ is built strangely at line 0 - optparse (/home/ksolaar/
Softwares/pyinstaller/optparse.pyc)
W: delayed exec statement detected at line 0 - socket (/usr/lib/
python2.5/socket.pyc)
W: delayed eval hack detected at line 0 - os (/usr/lib/python2.5/
os.pyc)
W: __all__ is built strangely at line 0 - __future__ (/usr/lib/
python2.5/__future__.pyc)
W: __all__ is built strangely at line 0 - tokenize (/usr/lib/python2.5/
tokenize.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
ksolaar/Softwares/pyinstaller/iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
ksolaar/Softwares/pyinstaller/iu.pyc)
W: delayed eval hack detected at line 0 - gettext (/usr/lib/python2.5/
gettext.pyc)
W: delayed __import__ hack detected at line 0 - optik.option_parser (/
home/ksolaar/Softwares/pyinstaller/optik/option_parser.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (/usr/
lib/python2.5/warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (/
usr/lib/python2.5/warnings.pyc)
W: __all__ is built strangely at line 0 - optik (/home/ksolaar/
Softwares/pyinstaller/optik/__init__.pyc)

and my spec file content :

# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
os.path.join(HOMEPATH,'support/useUnicode.py'), '/home/ksolaar/Desktop/
sIBL_GUI/src/Releases/linux/Source/sIBL_GUI.py'],
pathex=['/mnt/hgfs/sIBL_GUI/src'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=1,
name=os.path.join('build/pyi.linux2/sIBL_GUI', 'sIBL_GUI'),
debug=False,
strip=False,
upx=False,
console=1 )
coll = COLLECT( exe,
a.binaries,
a.zipfiles,
strip=False,
upx=False,
name=os.path.join('dist', 'sIBL_GUI'))

Kel Solaar

unread,
Oct 7, 2008, 5:43:20 PM10/7/08
to PyInstaller
And My command to run the spec/build :

python /home/ksolaar/Softwares/pyinstaller/Makespec.py -w /home/
ksolaar/Desktop/sIBL_GUI/src/Releases/linux/Source/sIBL_GUI.py -o /
home/ksolaar/Desktop/sIBL_GUI/src/Releases/linux/
python /home/ksolaar/Softwares/pyinstaller/Build.py /home/ksolaar/
Desktop/sIBL_GUI/src/Releases/linux/sIBL_GUI.spec

and I run the program with ./sIBL_GUI

hope thats helps.

Thomas

Hartmut Goebel

unread,
Oct 8, 2008, 8:01:41 AM10/8/08
to PyIns...@googlegroups.com

> exe = EXE(pyz,
> a.scripts,
> exclude_binaries=1,
> name=os.path.join('build/pyi.linux2/sIBL_GUI', 'sIBL_GUI'),
> debug=False,
> strip=False,
> upx=False,
> console=1 )
> coll = COLLECT( exe,
> a.binaries,
> a.zipfiles,
> strip=False,
> upx=False,
> name=os.path.join('dist', 'sIBL_GUI'))

You are creating the exe in the current dir, but all other required
files are put into dist/sIBL_GUI/

Try running dist/sIBL_GUI/sIBL_GUI

Kel Solaar

unread,
Oct 8, 2008, 10:23:33 AM10/8/08
to PyInstaller
mmmh I find my exe in dist/sIBL_GUI/sIBL_GUI and that's from where I'm
launching the ./sIBL_GUI
I'm even deleting the build and dist folders each time I rebuild the
executable to be sure everything refresh correctly.
I did some test with the "--onefile" option, and checked the archive
content with ArchiveViewer.py. In the verbose of the script I clearlly
see that the libraries are included.
The problem with this is that as soon as I launch the program I get a
segmentation fault and if I dont build with "--onefile" do an "export
LD_LIBRARY_PATH=/home/ksolaar/Desktop/sIBL_GUI/src/Releases/linux/
dist" (the directory will contain all my libraries) in a shell,
whatever I type after in the shell result in a segmentation fault too :
[ Really strange oO

Kel Solaar

unread,
Oct 8, 2008, 2:55:52 PM10/8/08
to PyInstaller
I did some more tests and I want to add that the Segmentation Fault
with the "--onefile" option builded executable only happen on my test
release computer. On the build computer everything is fine.

Hartmut Goebel

unread,
Oct 21, 2008, 6:32:45 AM10/21/08
to PyIns...@googlegroups.com
Kel Solaar schrieb:

> mmmh I find my exe in dist/sIBL_GUI/sIBL_GUI and that's from where I'm
> launching the ./sIBL_GUI

Hard to debug remotely.

On another list I got these tips regarding PyInstaller and PyQT (untested):

* Use SVN trunk since only this includes the hooks for PyQT 4
svn co http://svn.pyinstaller.python-hosting.com/trunk pyinstaller
* the hook depends on whether PyQT 3 or PyQT 4 is used.
* list of hooks:
<http://pyinstaller.python-hosting.com/browser/trunk/hooks/>

Hope this helps.

Kel Solaar

unread,
Oct 25, 2008, 10:45:37 AM10/25/08
to PyInstaller
Hi Hartmut o/

Thanks for your help again :)
I'm using the svn version currently, and still getting the problem but
I have half a solution : If I compile without commenting the
bindepend.py lib regex, I'm of course getting the libQtCore.so.4
missing error ( Including it in the package was resultin in seg
fault ) but if I install those libraries on the target computer it
seems to run pretty well. So to resume : now I manage to compile my
program and get it half packaged, I'm still qt dependant but that
should do the trick until there is a clean workaround. By the way the
code source of my program is here : http://kelsolaar.hdrlabs.com/
sIBL_Framework -> sIBL_GUI -> Sources

Thomas
>  smime.p7s
> 6KAfficherTélécharger
Reply all
Reply to author
Forward
0 new messages