[PyQt] chapter6-plugins example does not work with fresh build or wheel
Russell Warren
russ at perspexis.com
Wed Feb 8 14:00:16 GMT 2017
Wrestling with this some more, I'm now stuck with an undefined symbol
(PyExc_RunTimeError) per below. The need to add LD_LIBRARY_PATH here (in
order to find libpython3.5m.so.1.0) to move forward makes me think
something else is wrong, too. I'm certainly having more trouble with this
than I would expect from the docs at
http://pyqt.sourceforge.net/Docs/PyQt5/qml.html.
Is this maybe due to using the nightly snapshot? I see a 5.8 in the
snapshot name, and I'm on 5.7.1. I moved to the snapshot because this was
failing with the wheel.
---
$ qmake --version
QMake version 3.0
Using Qt version 5.7.1 in /home/russ/Qt/5.7/gcc_64/lib
$ which qmake
/home/russ/Qt/5.7/gcc_64/bin/qmake
$ which qmlscene
/home/russ/Qt/5.7/gcc_64/bin/qmlscene
$ tree -n --charset=ascii
.
|-- app.qml
`-- Charts
|-- chartsplugin.py
|-- piechart.py
|-- pieslice.py
`-- qmldir
1 directory, 5 files
$ cat Charts/qmldir
module Charts
plugin pyqt5qmlplugin /home/russ/Qt/5.7/gcc_64/plugins/PyQt5
$ QML2_IMPORT_PATH=. qmlscene app.qml
file:///home/russ/code/PyQt5_gpl-5.8.dev1702080008/examples/quick/tutorials/extending/chapter6-plugins/app.qml:42
plugin cannot be loaded for module "Charts": Cannot load library
/home/russ/Qt/5.7/gcc_64/plugins/PyQt5/libpyqt5qmlplugin.so:
(libpython3.5m.so.1.0: cannot open shared object file: No such file or
directory)
$ 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.8.dev1702080008/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py",
line 41, in <module>
from PyQt5.QtQml import qmlRegisterType, QQmlExtensionPlugin
ImportError:
/home/russ/miniconda3/envs/qtclient/lib/python3.5/site-packages/PyQt5/QtQml.so:
undefined symbol: PyExc_RuntimeError
file:///home/russ/code/PyQt5_gpl-5.8.dev1702080008/examples/quick/tutorials/extending/chapter6-plugins/app.qml:42
module "Charts" is not installed
On Wed, Feb 8, 2017 at 12:04 AM, Russell Warren <russ at perspexis.com> wrote:
> ... and an strace of the failed execution:
>
> https://bpaste.net/raw/b61ac215af60
>
>
>
> On Tue, Feb 7, 2017 at 11:59 PM, Russell Warren <russ at perspexis.com>
> wrote:
>
>> With a freshly compiled sip and PyQt5 (on Debian) from the nightly
>> snapshots, I am unable to run the chapter6-plugins example. It fails with:
>>
>> plugin cannot be loaded for module "Charts": Cannot load library
>> /home/russ/Qt/5.7/gcc_64/plugins/PyQt5/libpyqt5qmlplugin.so:
>> (libpython3.5m.so.1.0: cannot open shared object file: No such file or
>> directory)
>>
>> This same error happens when attempting with the wheel.
>>
>> Below is the chain of events (with extra info) to reproduce:
>>
>> $ cd ~/code/PyQt5_gpl-5.8.dev1702080008/examples/quick/tutorials/
>> extending/chapter6-plugins/
>> $ python --version
>> Python 3.5.2 :: Continuum Analytics, Inc.
>> $ qmake --version
>> QMake version 3.0
>> Using Qt version 5.7.1 in /home/russ/Qt/5.7/gcc_64/lib
>> $ sip -V
>> 4.19.1.dev1702050216
>> $ python -c "from PyQt5 import QtCore; print(QtCore.PYQT_VERSION_STR)"
>> 5.8.dev1702080008
>> $ find . -type f
>> ./Charts/piechart.py
>> ./Charts/pieslice.py
>> ./Charts/chartsplugin.py
>> ./Charts/qmldir
>> ./app.qml
>> $ QML2_IMPORT_PATH=. qmlscene app.qml
>> file:///home/russ/code/PyQt5_gpl-5.8.dev1702080008/examples/
>> quick/tutorials/extending/chapter6-plugins/app.qml:42 plugin cannot be
>> loaded for module "Charts": Cannot load library
>> /home/russ/Qt/5.7/gcc_64/plugins/PyQt5/libpyqt5qmlplugin.so:
>> (libpython3.5m.so.1.0: cannot open shared object file: No such file or
>> directory)
>> $ cp /home/russ/miniconda3/envs/qtclient/lib/libpython3.5m.so Charts/
>> $ ln -s libpython3.5m.so Charts/libpython3.5m.so.1.0
>> $ ls -l Charts/
>> total 9944
>> -rw-r--r-- 1 russ russ 2314 Feb 7 21:30 chartsplugin.py
>> -rwxr-xr-x 1 russ russ 10165073 Feb 7 23:40 libpython3.5m.so
>> lrwxrwxrwx 1 russ russ 16 Feb 7 23:41 libpython3.5m.so.1.0 ->
>> libpython3.5m.so
>> -rw-r--r-- 1 russ russ 2600 Feb 7 21:30 piechart.py
>> -rw-r--r-- 1 russ russ 3136 Feb 7 21:30 pieslice.py
>> -rw-r--r-- 1 russ russ 75 Feb 7 22:55 qmldir
>> $ QML2_IMPORT_PATH=. qmlscene app.qml
>> file:///home/russ/code/PyQt5_gpl-5.8.dev1702080008/examples/
>> quick/tutorials/extending/chapter6-plugins/app.qml:42 plugin cannot be
>> loaded for module "Charts": Cannot load library
>> /home/russ/Qt/5.7/gcc_64/plugins/PyQt5/libpyqt5qmlplugin.so:
>> (libpython3.5m.so.1.0: cannot open shared object file: No such file or
>> directory)
>> $ cat Charts/qmldir
>> module Charts
>> plugin pyqt5qmlplugin /home/russ/Qt/5.7/gcc_64/plugins/PyQt5
>> $ ls /home/russ/Qt/5.7/gcc_64/plugins/PyQt5 -l
>> total 28
>> -rwxr-xr-x 1 russ russ 26136 Feb 7 23:26 libpyqt5qmlplugin.so
>>
>>
>>
>
>
> --
> Russell Warren
> Perspexis Technologies Inc.
>
> This information is confidential and intended solely for the use of the
> individual or entity to whom it is addressed.
> If you have received this email in error, please notify the sender
> immediately.
>
--
Russell Warren
Perspexis Technologies Inc.
This information is confidential and intended solely for the use of the
individual or entity to whom it is addressed.
If you have received this email in error, please notify the sender
immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170208/42dd9d53/attachment.html>
More information about the PyQt
mailing list