[PyQt] chapter6-plugins example does not work with fresh build or wheel

Russell Warren russ at perspexis.com
Wed Feb 8 16:21:10 GMT 2017


Since I suspected the '5.8' in the nightly snapshot, I just rebuilt PyQt5
using the 5.7.1 version.  I also rebuilt sip for good measure.

Same problem: "PyCapsule_Import could not import module "sip"' due to an
undefined symbol (PyExc_RuntimeError)

Imports do work when I run directly.  Not sure what is happening here.

End intent here is to try and use `qmltestrunner` with QObjects regsitered
from PyQt5 using `qmlRegisterType`.  Not sure of any other way to do this
other than through the plugin path (via 'QQmlExtensionPlugin').

Has anyone managed to get PyQt5 qml/qmlscene plugins working? Docs are here:
http://pyqt.sourceforge.net/Docs/PyQt5/qml.html#writing-python-plugins-for-qmlscene


---

$ LD_LIBRARY_PATH=$(dirname $(which python))/../lib/:$LD_LIBRARY_PATH
QML2_IMPORT_PATH=. qmlscene app.qml
ImportError: PyCapsule_Import could not import module "sip"
Traceback (most recent call last):
  File
"/home/russ/code/PyQt5_gpl-5.7.1/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py",
line 41, in <module>
    from PyQt5.QtQml import qmlRegisterType, QQmlExtensionPlugin
ImportError:
/home/russ/miniconda3/envs/qtext/lib/python3.5/site-packages/PyQt5/QtQml.so:
undefined symbol: PyExc_RuntimeError
file:///home/russ/code/PyQt5_gpl-5.7.1/examples/quick/tutorials/extending/chapter6-plugins/app.qml:42
module "Charts" is not installed
$ LD_LIBRARY_PATH=$(dirname $(which python))/../lib/:$LD_LIBRARY_PATH
QML2_IMPORT_PATH=. python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sip
>>> from PyQt5.QtQml import qmlRegisterType, QQmlExtensionPlugin
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170208/b865aba1/attachment.html>


More information about the PyQt mailing list