thp / pyotherside

Python Bindings for Qt 5 and Qt 6. Allows you to access a CPython 3 interpreter directly from your Qt QML user interface code.
https://thp.io/2011/pyotherside/
Other
364 stars 49 forks source link

Module not detected, assertion `pyotherside_mod' failed #120

Closed kuba-orlik closed 3 years ago

kuba-orlik commented 3 years ago

I'm trying to run PyOtherSide in a QT5 application in Manjaro GNU/Linux. QML can't find the pyotherside module even after I installed it from the community package. The files are all there:

$ find /usr/lib/qt/qml/io/thp                                                                                                                              
/usr/lib/qt/qml/io/thp
/usr/lib/qt/qml/io/thp/pyotherside
/usr/lib/qt/qml/io/thp/pyotherside/pyotherside.qmltypes
/usr/lib/qt/qml/io/thp/pyotherside/libpyothersideplugin.so
/usr/lib/qt/qml/io/thp/pyotherside/qmldir

But QML crashes and complains:

module "io.thp.pyotherside" is not installed

I've tried copying the /usr/lib/qt/qml/io dir to a directory within my project's root and pointed the QML2_IMPORT_PATH env variable at it, but then it gives me:

python3: qpython_priv.cpp:548: QPythonPriv::QPythonPriv(): Assertion `pyotherside_mod' failed.
kuba-orlik commented 3 years ago

Ok, I've just realized that I should run the qml file with qmlscene main.qml, and not run the pyside main.py script that renders the main.qml file. I thought that pyside and pyotherside can be mixed? But apparently they cannot

thp commented 3 years ago

Yes, PyOtherSide is an alternative to PySide.