[PyQt] Can't get PyQt5 to work

Phil Thompson phil at riverbankcomputing.com
Tue Apr 8 23:31:22 BST 2014


On 08-04-2014 9:23 pm, Eddy Ilg wrote:
> Hi,
>
>
> I am trying to get PyQt5 to work, but without luck. I have my own
> class named Entity, for which with the help of the current sip 
> version
> from the website I am creating a shared library.
>
> When compling everything (PyQt, SIP, Entity.sip) with python 2.7, I
> succeed to import Entity in python, but performing any method call
> that makes use of QString crashes (other methods work). A backtrace
> showed that the crash is somewhere within "sip.o" (sorry I don't have
> it any more. Functions that return QString also crash.
>
> However, I decided to try with Python 3.4. I recompiled everything
> and now I am getting the following error message:
>
> Python 3.4.0 (default, Apr  8 2014, 22:02:32)
> [GCC 4.6.3] on linux
> Type "help", "copyright", "credits" or "license" for more 
> information.
>>>> import Entity
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: dynamic module does not define init function 
> (PyInit_Entity)
>>>>
>
> Checking the symbols of Entity.so gives:
> # nm Entity.so  | grep PyInit_Entity
> 0000000000001e5c t PyInit_Entity
> 0000000000206850 b _ZZ13PyInit_EntityE11sip_methods
> 00000000002062c0 d _ZZ13PyInit_EntityE14sip_module_def
>
> The function is clearly there! Why can it not be found by python?
>
> One more thing, importing pyqtconfig as in the SIP tutorial also 
> fails:
>>>> from PyQt5 import pyqtconfig
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: cannot import name 'pyqtconfig'
>
> The configure options were:
> python configure.py --qmake
> /misc/software-lin/Qt-5.2.1/5.2.1/gcc_64/bin/qmake --sip
> /home/x/bin/sip --sip-incdir /home/x/include --destdir
> /home/ilge/lib/python3.4/ --bindir /home/x/bin --no-designer-plugin
> --no-qml-plugin --assume-shared --pyuic5-interpreter
> /home/x/bin/python3.4 --no-sip-files
>
> Why is pyqtconfig missing?

It is specific to PyQt4. I've updated the SIP docs to make this more 
clear.

Phil


More information about the PyQt mailing list