[PyQt] PyQT4 ImportError, how to debug this?

appzer0 appzer0 at free.fr
Tue Oct 15 12:20:00 BST 2013


Hello PyQT guys,

I am trying to know what I am doing wrong on my homemade system. PyQt 
shows that error and I would like to know how to debug this as I am not 
a Python dev, just a packager. So far strace and the Python's verbose 
output did not help. I've compared with other distros and we appear to 
have the same Python package file lists. I've rebuilt again and again 
SIP, Qt, Python, PyQT, but no success after a week of fails so I get in 
touch with you guys, maybe you'll see what I am doing wrong.

My system: Linux 3.10 x86_64, glibc 2.17, gcc 4.8.1, Python 2.7 (tried 
with Python 3.3.2 as well, same problem).

PLease find below the error outputs and follow the pastebin link to see 
a strace log and the Pyqt and SIP packages' filelists (so this e-mail 
wont get over 100KB and be rejected).
Any extra info neede, just ask.

Any help will be greatly appreciated. Thanks!


The ImportError output:

---
$ python -d -c 'import PyQt4; from PyQt4 import QtCore;'
Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: dynamic module does not define init function (initQtCore)
---

Same with verbose output:

---
$ python -v -d -c 'import PyQt4; from PyQt4 import QtCore;'
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib64/python2.7/site.pyc matches /usr/lib64/python2.7/site.py
import site # precompiled from /usr/lib64/python2.7/site.pyc
# /usr/lib64/python2.7/os.pyc matches /usr/lib64/python2.7/os.py
import os # precompiled from /usr/lib64/python2.7/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib64/python2.7/posixpath.pyc matches 
/usr/lib64/python2.7/posixpath.py
import posixpath # precompiled from /usr/lib64/python2.7/posixpath.pyc
# /usr/lib64/python2.7/stat.pyc matches /usr/lib64/python2.7/stat.py
import stat # precompiled from /usr/lib64/python2.7/stat.pyc
# /usr/lib64/python2.7/genericpath.pyc matches 
/usr/lib64/python2.7/genericpath.py
import genericpath # precompiled from /usr/lib64/python2.7/genericpath.pyc
# /usr/lib64/python2.7/warnings.pyc matches 
/usr/lib64/python2.7/warnings.py
import warnings # precompiled from /usr/lib64/python2.7/warnings.pyc
# /usr/lib64/python2.7/linecache.pyc matches 
/usr/lib64/python2.7/linecache.py
import linecache # precompiled from /usr/lib64/python2.7/linecache.pyc
# /usr/lib64/python2.7/types.pyc matches /usr/lib64/python2.7/types.py
import types # precompiled from /usr/lib64/python2.7/types.pyc
# /usr/lib64/python2.7/UserDict.pyc matches 
/usr/lib64/python2.7/UserDict.py
import UserDict # precompiled from /usr/lib64/python2.7/UserDict.pyc
# /usr/lib64/python2.7/_abcoll.pyc matches /usr/lib64/python2.7/_abcoll.py
import _abcoll # precompiled from /usr/lib64/python2.7/_abcoll.pyc
# /usr/lib64/python2.7/abc.pyc matches /usr/lib64/python2.7/abc.py
import abc # precompiled from /usr/lib64/python2.7/abc.pyc
# /usr/lib64/python2.7/_weakrefset.pyc matches 
/usr/lib64/python2.7/_weakrefset.py
import _weakrefset # precompiled from /usr/lib64/python2.7/_weakrefset.pyc
import _weakref # builtin
# /usr/lib64/python2.7/copy_reg.pyc matches 
/usr/lib64/python2.7/copy_reg.py
import copy_reg # precompiled from /usr/lib64/python2.7/copy_reg.pyc
# /usr/lib64/python2.7/traceback.pyc matches 
/usr/lib64/python2.7/traceback.py
import traceback # precompiled from /usr/lib64/python2.7/traceback.pyc
# /usr/lib64/python2.7/sysconfig.pyc matches 
/usr/lib64/python2.7/sysconfig.py
import sysconfig # precompiled from /usr/lib64/python2.7/sysconfig.pyc
# /usr/lib64/python2.7/re.pyc matches /usr/lib64/python2.7/re.py
import re # precompiled from /usr/lib64/python2.7/re.pyc
# /usr/lib64/python2.7/sre_compile.pyc matches 
/usr/lib64/python2.7/sre_compile.py
import sre_compile # precompiled from /usr/lib64/python2.7/sre_compile.pyc
import _sre # builtin
# /usr/lib64/python2.7/sre_parse.pyc matches 
/usr/lib64/python2.7/sre_parse.py
import sre_parse # precompiled from /usr/lib64/python2.7/sre_parse.pyc
# /usr/lib64/python2.7/sre_constants.pyc matches 
/usr/lib64/python2.7/sre_constants.py
import sre_constants # precompiled from 
/usr/lib64/python2.7/sre_constants.pyc
# /usr/lib64/python2.7/_sysconfigdata.pyc matches 
/usr/lib64/python2.7/_sysconfigdata.py
import _sysconfigdata # precompiled from 
/usr/lib64/python2.7/_sysconfigdata.pyc
import encodings # directory /usr/lib64/python2.7/encodings
# /usr/lib64/python2.7/encodings/__init__.pyc matches 
/usr/lib64/python2.7/encodings/__init__.py
import encodings # precompiled from 
/usr/lib64/python2.7/encodings/__init__.pyc
# /usr/lib64/python2.7/codecs.pyc matches /usr/lib64/python2.7/codecs.py
import codecs # precompiled from /usr/lib64/python2.7/codecs.pyc
import _codecs # builtin
# /usr/lib64/python2.7/encodings/aliases.pyc matches 
/usr/lib64/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from 
/usr/lib64/python2.7/encodings/aliases.pyc
# /usr/lib64/python2.7/encodings/utf_8.pyc matches 
/usr/lib64/python2.7/encodings/utf_8.py
import encodings.utf_8 # precompiled from 
/usr/lib64/python2.7/encodings/utf_8.pyc
Python 2.7.5 (default, Oct 12 2013, 09:23:06)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import PyQt4 # directory /usr/lib64/python2.7/site-packages/PyQt4
# /usr/lib64/python2.7/site-packages/PyQt4/__init__.pyc has bad mtime
import PyQt4 # from /usr/lib64/python2.7/site-packages/PyQt4/__init__.py
# can't create /usr/lib64/python2.7/site-packages/PyQt4/__init__.pyc
dlopen("/usr/lib64/python2.7/site-packages/PyQt4/QtCore.so", 2);
Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: dynamic module does not define init function (initQtCore)
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] encodings
# cleanup[1] site
# cleanup[1] PyQt4
# cleanup[1] sysconfig
# cleanup[1] abc
# cleanup[1] _weakrefset
# cleanup[1] sre_constants
# cleanup[1] re
# cleanup[1] _codecs
# cleanup[1] _warnings
# cleanup[1] zipimport
# cleanup[1] _sysconfigdata
# cleanup[1] encodings.utf_8
# cleanup[1] codecs
# cleanup[1] signal
# cleanup[1] traceback
# cleanup[1] posix
# cleanup[1] encodings.aliases
# cleanup[1] exceptions
# cleanup[1] _weakref
# cleanup[1] sre_compile
# cleanup[1] _sre
# cleanup[1] sre_parse
# cleanup[2] copy_reg
# cleanup[2] posixpath
# cleanup[2] errno
# cleanup[2] _abcoll
# cleanup[2] types
# cleanup[2] genericpath
# cleanup[2] stat
# cleanup[2] warnings
# cleanup[2] UserDict
# cleanup[2] os.path
# cleanup[2] linecache
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 19 unfreed ints
# cleanup floats
---

strace output and filelists are on: http://pastebin.com/X508nFYS

The buildcsript for PyQT is available on my GIT repo there: 
http://git.tuxfamily.org/0linux/0linux.git?p=0linux/0linux.git;a=blob;f=opt/pyqt/pyqt.recette

Thanks!

appzer0 - http://0linux.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20131015/2922f8c6/attachment.html>


More information about the PyQt mailing list