[PyQt] PyQt 4.4.2 / SIP 4.7.6 in custom directories : API version
mismatch (3.6 instead of 3.7)
jbd
jbdenis at dental-on-line.fr
Fri May 30 08:39:05 BST 2008
Hello everybody !
I ran into some troubles with my Qt installation.
Here is my setup. I'm running a debian etch with the official
repositories. I have Qt 4.2 and PyQt 4.0 bindings, SIP 4.4.5 and
python-sip4 4.7.4 installed on my system using apt/aptitude.
I've decided to build a static Qt 4.4 in my home directory :
--------------------------------------------------------------------------
export STATIC_LIBS_DIRECTORY=MY_DIRECTORY
./configure -static -prefix=$STATIC_LIBS_DIRECTORY mycompilationoptions
make && make install
--------------------------------------------------------------------------
=> the examples are running fine
I've compiled and installed SIP 4.7.6 in the same directory :
--------------------------------------------------------------------------
python configure.py -k -b $STATIC_LIBS_DIRECTORY/bin -d
$STATIC_LIBS_DIRECTORY/lib/python2.4/site-packages -e
$STATIC_LIBS_DIRECTORY/include/python2.4 -v $STATIC_LIBS_DIRECTORY/share/sip
--------------------------------------------------------------------------
Here is an excerpt from the log seams fine to me :
--------------------------------------------------------------------------
Qt v4.4.0 free edition is being used.
SIP 4.7.6 is being used.
The Qt header files are in /home/jbd/dol/dolstatic/include.
The static Qt libraries are in /home/jbd/dol/dolstatic/lib.
The Qt binaries are in /home/jbd/dol/dolstatic/bin.
The Qt mkspecs directory is in /home/jbd/dol/dolstatic.
These PyQt modules will be built: QtCore QtGui QtHelp QtNetwork QtOpenGL
QtScript QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns QtAssistant.
The PyQt Python package will be installed in
/home/jbd/dol/dolstatic/lib/python2.4/site-packages.
The Designer plugin will be installed in
/home/jbd/dol/dolstatic/plugins/designer.
The PyQt .sip files will be installed in
/home/jbd/dol/dolstatic/share/sip/PyQt4.
pyuic4, pyrcc4 and pylupdate4 will be installed in
/home/jbd/dol/dolstatic/bin.
--------------------------------------------------------------------------
I've compiled PyQt4 4.4.2 in the same directory using the consolidate
option :
--------------------------------------------------------------------------
export CPATH=$STATIC_LIBS_DIRECTORY/include:$CPATH
export
PYTHONPATH=$STATIC_LIBS_DIRECTORY/lib/python2.4/site-packages/:$PYTHONPATH
export PATH=$STATIC_LIBS_DIRECTORY/bin:$PATH
python configure.py --confirm-license --consolidate -b
$STATIC_LIBS_DIRECTORY/bin -d
$STATIC_LIBS_DIRECTORY/lib/python2.4/site-packages -p
$STATIC_LIBS_DIRECTORY/plugins
--------------------------------------------------------------------------
Compilation and installation run without problems.
The import PyQt4 runs fine, but when i try to import a module, it fails :
--------------------------------------------------------------------------
$ python -c "import PyQt4"
$ python -c "from PyQt4 import QtCore"
Traceback (most recent call last):
File "<string>", line 1, in ?
RuntimeError: the sip module supports API v3.0 to v3.6 but the
PyQt4.QtCore module requires API v3.7
--------------------------------------------------------------------------
I've just found that when i'm running an interactive shell, if a "double
import" the module, it runs fine. Weird.
--------------------------------------------------------------------------
$ export
PYTHONPATH=$STATIC_LIBS_DIRECTORY/lib/python2.4/site-packages/:$PYTHONPATH
$ python
Python 2.4.4 (#2, Apr 15 2008, 23:43:20)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4 import QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in ?
RuntimeError: the sip module supports API v3.0 to v3.6 but the
PyQt4.QtCore module requires API v3.7
>>> from PyQt4 import QtCore
>>> QtCore.qVersion()
'4.4.0'
--------------------------------------------------------------------------
I would be happy with any suggestions =)
Jbd
More information about the PyQt
mailing list