Tamo,
I did it in such a way as to avoid changing the system-wide
default.
I'm on Raspberry Pi, and several system-related functions still
expect Python 2.7.
What I did is certainly not the only way, but it works for me...
On my system, /usr/local/sbin is already in the path ahead of
system default locations and it is set via /etc/profile (but you
could do it in your ~/.profile or ~/.bashrc or other dot files):
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Based on that, I did the following:
pi@nixie:~ $ cd /usr/local/sbin
pi@nixie:/usr/local/sbin $ sudo ln -s ../../bin/python3 python
That yields this behavior:
pi@nixie:~ $ which python
/usr/local/sbin/python
pi@nixie:~ $ env python --version
Python 3.7.3
And because the majority of weewx python scripts begin with the
following, it means they will end up using Python 3:
#!/usr/bin/env python
HTH,
Regards,
\Leon
Tarmo wrote on 4/30/20 2:54 PM: