Next revision | Previous revision |
technical:recipes:pyqt5-in-virtualenv [2019-05-13 16:01] – created frey | technical:recipes:pyqt5-in-virtualenv [2020-01-06 10:52] (current) – [Setup a virtual environment] anita |
---|
- Use ''ldd'' to check that the shared libraries installed by ''pip'' don't have missing dependencies | - Use ''ldd'' to check that the shared libraries installed by ''pip'' don't have missing dependencies |
None of this helped. In the end, asking the underlying Qt5 library to verbosely log its behavior was the key: | None of this helped. In the end, asking the underlying Qt5 library to verbosely log its behavior was the key: |
<code bash> | <code> |
$ QT_DEBUG_PLUGINS=1 python qt-test.py | $ QT_DEBUG_PLUGINS=1 python qt-test.py |
: | : |
All code examples were tested on the Caviness cluster. | All code examples were tested on the Caviness cluster. |
| |
<code bash> | <code> |
$ vpkg_require anaconda/5.2.0:python3 | $ vpkg_require anaconda/5.2.0:python3 |
$ conda create -p ~/qt-test python==3 pip | $ conda create -p ~/qt-test python=3 pip |
: | : |
$ source activate ~/qt-test | $ source activate ~/qt-test |
</WRAP> | </WRAP> |
| |
<code bash> | <code> |
(/home/1001/qt-test) $ mkdir attic src | (/home/1001/qt-test) $ mkdir attic src |
(/home/1001/qt-test) $ cd attic | (/home/1001/qt-test) $ cd attic |
Once SIP is built and installed into the virtualenv, PyQt5 can be handled. By default the configuration script will enable all PyQt5 sub-modules for which necessary pre-requisite Qt5 libraries and headers are available. The ''--disable'' flag can be used to prevent any unnecessary sub-modules from being built. | Once SIP is built and installed into the virtualenv, PyQt5 can be handled. By default the configuration script will enable all PyQt5 sub-modules for which necessary pre-requisite Qt5 libraries and headers are available. The ''--disable'' flag can be used to prevent any unnecessary sub-modules from being built. |
| |
<code bash> | <code> |
(/home/1001/qt-test) $ cd ~/qt-test/attic | (/home/1001/qt-test) $ cd ~/qt-test/attic |
(/home/1001/qt-test) $ wget 'https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.2/PyQt5_gpl-5.12.2.tar.gz' | (/home/1001/qt-test) $ wget 'https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.12.2/PyQt5_gpl-5.12.2.tar.gz' |
At this point you can test PyQt5 in your virtualenv: | At this point you can test PyQt5 in your virtualenv: |
| |
<code bash> | <code> |
(/home/1001/qt-test) $ cd ~/qt-test | (/home/1001/qt-test) $ cd ~/qt-test |
(/home/1001/qt-test) $ cat >qt-test.py <<EOT | (/home/1001/qt-test) $ cat >qt-test.py <<EOT |