I didn’t have a 2nd gen autopi, but I believe that model also encages a Raspberry Pi Zero W.
In that case it should come with python 2.7 and 3.5 (as many unix based systems).
I cannot check right now because I don’t have the autopi with me, but from the command line
you can type
python2 -V or
python3 -V to be sure, and
which python to
find out about its path in the system.
In principle it should be possible to install python 3.7, but this may (or may not) affect other
autopi processes. You could try and worse case flash the autopi. The point is that depending
on what you want to do probably you won’t feel any difference between 3.5 and 3.7, so maybe
you could avoid installing the latter.
My last point to mention is that if possible, use a virtual environment so that you can freely install
the libraries (and libraries’ versions) that you wish. In this way, your python is encapsulated in an
environment (inside a folder), which is generally cleaner and could avoid problems. Sketch about
how to create a
python3 -m venv ~/py-envs/py-3.5
If you want to run a python script from the my.autopi.io interface, it will call python2 (at least when
I tried), but from there you can
activate your python environment and run the script with that python.
So the flow would be:
my.autopi.io --> python2 --> activate py-3.5 --> run script with py-3.5
There could be a better way to run python3, but this is the way I tried.
Hope it helps.