me_ganesh wrote: ↑
Fri May 24, 2019 11:15 am
how can there be two different versions of python?
I even deactivated my virtual environment
That is very normal (you should see some Macs). Both Python 2 and 3 are included by default on the Pi builds and modules get loaded into the release directory structure. e.g. V2 structure
and it’s equivalent in your own projects at http://as.ynchrono.us/2007/12/filesyste ... ct_21.html
. Note this can change depending on the platform you are on.
The command python is a link to the version 2 command so to access v3 you have to use python3 at the command line.
GUI editors (Thonny / Idle etc) can have different versions of Python used by default and Visual Code from MS lets you change versions from the editor.
If this sounds like a mess it is and trips lots of folk up lots of times BUT there is so much legacy code out there that removing Python2 is very hard to do.
From what I am seeing it’s best to either develop in Python 3 only (and use pip3 where needed) or live totally in a virtual environment where you can dictate how and where modules are loaded.
Need Pi spray - these things are breeding in my house...