<div dir="ltr"><div>Thank you Richard,</div><div><br></div><div>your workflow is almost exactly the same I am doing.</div><div><br></div><div>With the help of Nyall I have been able to track down the issue to a missing package<span style="font-family:arial,sans-serif"> <span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">python3-pyqt6.qtmultimedia</span>.</span></div><div><span style="font-family:arial,sans-serif"><br></span></div><div><span style="font-family:arial,sans-serif">The debugging process involved removing all the imports from <br></span></div><div><span style="font-family:monospace"></span></div><div><br></div><div><a href="https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui.sip.in">https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui.sip.in</a></div><div><br></div><div>and find the broken piece, to my surprise, removing the lines highlighted here</div><div><a href="https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui.sip.in#L16C1-L20C22">https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui.sip.in#L16C1-L20C22</a></div><div><br></div><div>eventually led to a readable error message (QtMultimedia could not be imported) instead of the corrupted one.</div><div><br></div><div>Why the error message gets corrupted after qsci is imported (or after </div><div><a href="https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui_auto.sip">https://github.com/qgis/QGIS/blob/master/python/PyQt6/gui/gui_auto.sip</a> is imports, I don't know which one is responsible of the issue) still remains a mystery to me.</div><div><br></div><div>Thank you all for the help!</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 21, 2025 at 8:23 PM Richard Duivenvoorde <<a href="mailto:rdmailings@duif.net" target="_blank">rdmailings@duif.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm on Trixie (next stable in a couple of weeks), and only build QWT myself from source:<br>
<br>
# <a href="https://qwt.sourceforge.io/qwtinstall.html" rel="noreferrer" target="_blank">https://qwt.sourceforge.io/qwtinstall.html</a><br>
# download the tar.bz2 from <a href="https://sourceforge.net/projects/qwt/files/qwt/6.3.0/" rel="noreferrer" target="_blank">https://sourceforge.net/projects/qwt/files/qwt/6.3.0/</a><br>
# unpack and go into ~/git/qwt-6.3.0 dir<br>
# error: qmake: could not find a Qt installation of '' -> <a href="https://askubuntu.com/questions/1460242/ubuntu-22-04-with-qt6-qmake-could-not-find-a-qt-installation-of" rel="noreferrer" target="_blank">https://askubuntu.com/questions/1460242/ubuntu-22-04-with-qt6-qmake-could-not-find-a-qt-installation-of</a>?<br>
qtchooser -install qt6 $(which qmake6)<br>
export QT_SELECT=qt6<br>
# create Makefile<br>
/usr/bin/qmake <a href="http://qwt.pro" rel="noreferrer" target="_blank">qwt.pro</a><br>
# compile<br>
make<br>
# install (in /usr/local/qwt-6.3.0 )<br>
sudo make install<br>
<br>
Then, leaving out a lot of stuff...:<br>
<br>
mkdir buildqt6;cd buildqt6;ccmake -GNinja -DBUILD_TESTING=FALSE -DENABLE_TESTS=OFF -DWITH_SERVER=FALSE -DWITH_3D=FALSE -DCMAKE_INSTALL_PREFIX=/home/richard/bin/qgis_/qt6/debug -DWITH_QWTPOLAR=OFF -DCMAKE_BUILD_TYPE=Debug -DWITH_GRASS=FALSE -DBUILD_WITH_QT6=TRUE -DWITH_OAUTH2_PLUGIN=FALSE -DWITH_WITH_SERVER_PLUGINS=OFF -DWITH_STAGED_PLUGINS=OFF -DWITH_PDAL=OFF -DWITH_QTWEBKIT=OFF -DQWT_INCLUDE_DIR=/usr/local/qwt-6.3.0/include -DQWT_LIBRARY=/usr/local/qwt-6.3.0/lib/libqwt.so ..<br>
<br>
in the same git repo as my qt5 build, QGIS works.<br>
<br>
I'm on python 3.13.5 here<br>
<br>
Not sure if this helps...<br>
<br>
Richard<br>
<br>
<br>
<br>
<br>
On 21-07-2025 17:52, Alessandro Pasotti via QGIS-Developer wrote:<br>
> <br>
> Thanks, I'm using Python 3.13 (that comes with that Ubuntu version).<br>
> <br>
> Now I'm trying with vcpkg ...<br>
> <br>
> <br>
> On Mon, Jul 21, 2025 at 5:35 PM pathmapper <<a href="mailto:pathmapper@posteo.de" target="_blank">pathmapper@posteo.de</a> <mailto:<a href="mailto:pathmapper@posteo.de" target="_blank">pathmapper@posteo.de</a>>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> I don't know what's wrong, but when I had similar problems, switching to<br>
> Python 3.12 solved them for me.<br>
> <br>
> Cheers,<br>
> Björn<br>
> <br>
> On 21.07.2025 16:58, Alessandro Pasotti via QGIS-Developer wrote:<br>
> > Hi,<br>
> ><br>
> > I am trying to build QGIS with QT6 on Ubuntu (tried 24.10 and 25.04),<br>
> > it builds without errors but when I run it, the following error<br>
> > appears:<br>
> ><br>
> > Couldn't load PyQGIS.<br>
> > Python support will be disabled.<br>
> ><br>
> > Traceback (most recent call last):<br>
> > File "", line 1, in<br>
> > File<br>
> > "/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python/qgis/gui/__init__.py",<br>
> > line 25, in<br>
> > from qgis._gui import *<br>
> > RuntimeError: qgis._gui cannot import type '���A� ' from<br>
> > PyQt6.QtCore<br>
> ><br>
> > Python version:<br>
> > 3.13.3 (main, Jun 16 2025, 18:15:32) [GCC 14.2.0]<br>
> ><br>
> > QGIS version:<br>
> > 3.99.0-Master 'Master', e717e3cd2b9<br>
> ><br>
> > Python path:<br>
> > ['/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python',<br>
> > '/home/ale/.local/share/QGIS/QGIS3/profiles/default/python',<br>
> > '/home/ale/.local/share/QGIS/QGIS3/profiles/default/python/plugins',<br>
> > '/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python/plugins',<br>
> > '/home/ale/dev/gdal/desktop-install/local/lib/python3.13/dist-packages',<br>
> > '/home/ale/dev/gdal/autotest/pymod', '/usr/lib/python313.zip',<br>
> > '/usr/lib/python3.13', '/usr/lib/python3.13/lib-dynload',<br>
> > '/usr/local/lib/python3.13/dist-packages',<br>
> > '/usr/lib/python3/dist-packages']<br>
> ><br>
> > I checked the QGIS/build/Desktop_QT6-Debug/output/python/qgis content<br>
> > and it looks legit.<br>
> ><br>
> > PyQt6 installation also looks ok, importing core works ok, only gui<br>
> > does not work.<br>
> ><br>
> > Any idea about what's going wrong?<br>
> ><br>
> > --<br>
> ><br>
> > Alessandro Pasotti<br>
> > QCooperative: <a href="http://www.qcooperative.net" rel="noreferrer" target="_blank">www.qcooperative.net</a> <<a href="http://www.qcooperative.net" rel="noreferrer" target="_blank">http://www.qcooperative.net</a>> [1]<br>
> > ItOpen: <a href="http://www.itopen.it" rel="noreferrer" target="_blank">www.itopen.it</a> <<a href="http://www.itopen.it" rel="noreferrer" target="_blank">http://www.itopen.it</a>> [2]<br>
> ><br>
> > Links:<br>
> > ------<br>
> > [1] <a href="https://www.qcooperative.net" rel="noreferrer" target="_blank">https://www.qcooperative.net</a> <<a href="https://www.qcooperative.net" rel="noreferrer" target="_blank">https://www.qcooperative.net</a>><br>
> > [2] <a href="http://www.itopen.it" rel="noreferrer" target="_blank">http://www.itopen.it</a> <<a href="http://www.itopen.it" rel="noreferrer" target="_blank">http://www.itopen.it</a>><br>
> ><br>
> > _______________________________________________<br>
> > QGIS-Developer mailing list<br>
> > <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a> <mailto:<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>><br>
> > List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a> <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>><br>
> > Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a> <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>><br>
> <br>
> <br>
> <br>
> -- <br>
> Alessandro Pasotti<br>
> QCooperative: <a href="http://www.qcooperative.net" rel="noreferrer" target="_blank">www.qcooperative.net</a> <<a href="https://www.qcooperative.net" rel="noreferrer" target="_blank">https://www.qcooperative.net</a>><br>
> ItOpen: <a href="http://www.itopen.it" rel="noreferrer" target="_blank">www.itopen.it</a> <<a href="http://www.itopen.it" rel="noreferrer" target="_blank">http://www.itopen.it</a>><br>
> <br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br>
</blockquote></div><div><br clear="all"></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Alessandro Pasotti</div><div>QCooperative: <a href="https://www.qcooperative.net" target="_blank">www.qcooperative.net</a><br></div>ItOpen: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div></div>