[QGIS-Developer] QGIS Python Versions

Greg Troxel gdt at lexort.com
Wed Apr 9 09:08:16 PDT 2025


Sergi Maspons - BGEO via QGIS-Developer <qgis-developer at lists.osgeo.org>
writes:

> I was wondering, is there a rule for which python version comes with
> each QGIS version?

No.  qgis is in general built from source, and will support multiple
versions, from some minimum to some max.  Each binary package
constructed from those sources will use a particular version.

It is therefore not meaningful to say that a version of qgis comes with
a specific python version.

> It would be very useful for developing plugins, because I thought that
> from QGIS 3.34 onwards it comes with Python 3.12. But I installed
> qgis-ltr (3.40.5) on debian and saw that it came with Python 3.11.

Presumably Debian 12, and operating system distributions tend to stay at
the python version they started with.  Python moves a bit too quickly.

> Is there a minimum Python version that all plugins should use? We've
> been using new syntax added on newer versions of Python thinking that
> if the latest QGIS release comes with a certain Python version, I
> could assume that my plugin (if I only want to support the last two
> LTR) must work with that python version.

In the qgis sources, look at CMakeLists and see what the minimum python
version is.   Stick to that.  Really; it's that simple.

> To summarize:
> - In my Windows machine, I have both QGIS 3.40.4 & 3.34.15 and they
>   both come with Python 3.12, therefore I assumed our plugin could use
>   Python 3.12 syntax and features.
> - In a Debian machine, I installed QGIS 3.40.5 and it came with Python
>   3.11.2.

Those are two data points and that does not establish that there could
not reasonably be a build of 3.40 with 3.10.  There are lots of "Laggard
Term Stable" distributions out there and they tend to have older
versions of ~everything in base.

It might be that 3.40's CMakeLists specifies 3.10 as minimum.



More information about the QGIS-Developer mailing list