I need to use Python3.7, so I followed these instructions to install it
curPath=${pwd}
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
sudo tar xzf Python-3.7.9.tgz
cd Python-3.7.9
sudo ./configure --enable-optimizations
cd ${pwd}
I then tried to run python -V and got
Command 'python3.7' not found, did you mean:
command 'python2.7' from deb python2.7 (2.7.18-1~20.04)
command 'python3.9' from deb python3.9 (3.9.0-5~20.04)
command 'python3.8' from deb python3.8 (3.8.5-1~20.04.2)
Try: sudo apt install <deb name>
Also I tried to run whereis python and got
whereis python
python: /usr/bin/python3.8 /usr/bin/python3.8-config /usr/lib/python3.8 /usr/lib/python2.7 /usr/lib/python3.9 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8