[PyQt] qmlscene plugin PyCapsule_Import sip error in virtualenv

Nenad Ognjanovic bgr.gyk at gmail.com
Thu Nov 6 14:10:18 GMT 2014


I've just tried this again with latest PyQt5 and sip snapshots on Qt
5.3.2 and I'm getting the same error. Does anyone have an idea how to
get the example running?

On Tue, Aug 12, 2014 at 5:02 PM, Nenad Ognjanovic <bgr.gyk at gmail.com> wrote:
> Hello,
> I'm getting an error when I attempt to run the Charts qmlscene plugin
> example on the latest PyQt and sip snapshots installed inside a virtualenv
> (Python 3.4).
>
> Running:
>     QML2_IMPORT_PATH="." qmlscene -I . app.qml
> gives the following error:
>     ImportError: PyCapsule_Import could not import module "sip"
>     Traceback (most recent call last):
>     File ".../Charts/chartsplugin.py", line 41, in <module>
>         from PyQt5.QtQml import qmlRegisterType, QQmlExtensionPlugin
>     ImportError: ...virtualenv/lib/python3.4/site-packages/PyQt5/QtQml.so:
>     undefined symbol: PyBool_Type
>     .../app.qml:42 module "Charts" is not installed
>
> Just running:
>     qmlscene -I . app.qml
> gives the following:
>     ImportError: PyCapsule_Import could not import module "sip"
>     .../app.qml:42 module "Charts" is not installed
>
> I suspect this PyCapsule_Import part tries to operate outside of virtualenv,
> maybe using wrong interpreter or looking up something in wrong place.
> Any ideas/hints?
>
> P.S.: The qmlscene plugin was installed successfully, I've managed to get
> the output of configure.py to say
>     "Re-writing .../chapter6-plugins/Charts/qmldir/..."
> by linking /usr/lib/x86_64-linux-gnu to virtualenv/lib/x86_64-linux-gnu
> (initially I was getting "The qmlscene plugin was disabled because the Python
> library couldn't be found.").
> The sip and PyQt configure steps were done using the following arguments,
> correspondingly:
>     python configure.py --debug -e virtualenv/include
>     python configure.py --debug --sip-incdir virtualenv/include


More information about the PyQt mailing list