[QGIS-Developer] QGIS Python Versions

Sergi Maspons - BGEO smaspons at bgeo.es
Wed Apr 9 09:14:40 PDT 2025


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

Oh, okay, I didn't know that. Thank you very much!

El 09/04/2025 a las 18:08, Greg Troxel via QGIS-Developer escribió:
> 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.
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20250409/81660cca/attachment.htm>


More information about the QGIS-Developer mailing list