Where can I discover the Python version installed in QGIS 2.18.1?
I would like to buy a book to introduce me at Python interface. I've found one that addresses the version 3.3 of Python.
Where can I discover the Python version installed in QGIS 2.18.1?
I would like to buy a book to introduce me at Python interface. I've found one that addresses the version 3.3 of Python.
Looks like in QGIS v3.0, python v3 will be implemented:
Updating Python 2.7 to Python 3: Currently we bundle in Python 2.7 in our windows installers and require 2.7 on other platforms where we do not co-bundle Python with QGIS. Python 3 is the latest version of python and is recommended by the Python project. Python 2 is slightly incompatible with Python 3 (in much the same way as QGIS 2 -> QGIS 3 will be incompatible). The python developers have made Python 3 largely backwards compatible to Python 2, but the compatibility in the opposite direction is not as good.
Here is the syntax you may run in the python console in QGIS to verify version:
import sys
print sys.version_info
Alongside sys.version_info, as mentioned above, you can use
import sys
sys.version
sys.version_info will give this kind of output (this comes from my copy of QGIS 2.18.1):
>>> import sys
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
sys.version will give the version number, alongside the compiler used:
>>> import sys
>>> sys.version
'2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]'
Another way to know what version of python you are using can be to run the following command on the python console that has QGIS:
from platform import python_version
print(python_version())
Since QGIS 3.20 you can use the Help > About to see the Python version.
Help > About in my QGIS 3.18. I see: QGIS version, Compiled against Qt, Compiled against GDAL/OGR, Compiled against GEOS, Compiled against SQLite, PostgreSQL Client Version, QWT Version, Compiled against PROJ, OS Version, Active python plugins, QGIS code revision, Running against Qt, Running against GDAL/OGR, Running against GEOS, Running against SQLite, SpatiaLite Version, QScintilla2 Version, Running against PROJ.
– Taras
Jul 14 '21 at 13:23