1

I am currently using Python version 3.6. Previously used QGIS 2.99 as it was throwing errors, shifted to QGIS version 3.4. With the help of this "How can I discover the Python version in QGIS?" , I found that QGIS 3.4 has Python version 3.7.0. By this I understood QGIS 3 will use Python 3.

Can Python 3.6 be used in QGIS version 3.4, will it support a standalone script?

  • I'm not sure I understand your question - particularly the bit about "will it support a standalone script". What do you mean by that? – Stev_k Nov 2 '18 at 14:03
  • QGIS version 3.4 support python 3.7. If I run python 3.6 codes will it make any difference? Can I call the QGIS function outside QGIS 3.4 in a standalone python script using Python version 3.6? – roshualine Nov 3 '18 at 11:01
1

I think a bit of context about the ultimate goal here would help - what you are asking sounds bizzare as the Python code for QGIS is far more dependent on the QGIS version than the Python version (apart from Pyhon 2 vs 3, which in any case was a major change in QGIS.

To answer the question "will it make any difference if I run code written in Python 3.6 in QGIS 3.4 (Python 3.7)" it depends on the script, but Python tends not to make radical changes on point releases so you may be OK.

The other question is a no - QGIS installs its own version of python with all the QGIS binding libraries, and each Python version is self-contained. So no, you could not call qgis functions from your 3.6 installation unless you compile qgis yourself to use Python 3.6, as far as I know.

  • 1
    it is a good answer but does omit aspects of the underlying os. For Windows I agree with that answer, but what about linux? I'm not sure, but i think qgis uses the system-wide python install. – Andreas Müller Dec 19 '18 at 11:27
  • True - you are probably right for Linux installs - admit to being Windows-centric in this case, despite also running on Linux! – Stev_k Dec 19 '18 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.