[QGIS-Developer] Building QGIS with QT6 on Ubuntu: Python error at start

Alessandro Pasotti apasotti at gmail.com
Mon Jul 21 07:58:10 PDT 2025


Hi,

I am trying to build QGIS with QT6 on Ubuntu (tried 24.10 and 25.04),
it builds without errors but when I run it, the following error appears:

Couldn't load PyQGIS.
Python support will be disabled.


Traceback (most recent call last):
  File "", line 1, in
  File "/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python/qgis/gui/__init__.py",
line 25, in
    from qgis._gui import *
RuntimeError: qgis._gui cannot import type '���A� ' from PyQt6.QtCore

Python version:
3.13.3 (main, Jun 16 2025, 18:15:32) [GCC 14.2.0]

QGIS version:
3.99.0-Master 'Master', e717e3cd2b9

Python path:
['/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python',
'/home/ale/.local/share/QGIS/QGIS3/profiles/default/python',
'/home/ale/.local/share/QGIS/QGIS3/profiles/default/python/plugins',
'/home/ale/dev/QGIS/build/Desktop_QT6-Debug/output/python/plugins',
'/home/ale/dev/gdal/desktop-install/local/lib/python3.13/dist-packages',
'/home/ale/dev/gdal/autotest/pymod', '/usr/lib/python313.zip',
'/usr/lib/python3.13', '/usr/lib/python3.13/lib-dynload',
'/usr/local/lib/python3.13/dist-packages', '/usr/lib/python3/dist-packages']


I checked the QGIS/build/Desktop_QT6-Debug/output/python/qgis content and
it looks legit.

PyQt6 installation also looks ok, importing core works ok, only gui does
not work.

Any idea about what's going wrong?


-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20250721/be04cee7/attachment.htm>


More information about the QGIS-Developer mailing list