sudo apt-get install python3.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.7 is already the newest version (3.7.10-1+bionic2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file 'security' in directory '/etc/apt/sources.list.d/' as it has no filename extension root@ubuntu:~# python3 -V Python 3.6.9
I presume you are a Linux user. I faced a similar issue when I was trying to install Python 3.9 but when I ran python -V in the terminal, it would tell me I had version 2. I can't guarantee
this will work but it worked for me. If you are using Ubuntu 20.04 a Linux distro, by default you have Python 3.9. In Ubuntu 18 and 16 there is also a Python version pre-installed. In your case, you need to first uninstall Python 3. Using this command in the terminal.
After uninstalling, reinstall as Python 3.9 version using this command:
Again if you're using an editor like Pycharm your base interpreter will be messed up! So please be careful when uninstalling. And this code works on Ubuntu which I presume is what you are working on. Another thing you need to install a repository to get Py 3.9. it's called deadsnakes I've mentioned the code above on how you could install it. I hope you faced no issues. Remember it worked for me but I'm not sure it will work for you. Enjoy with Python 3.9 if the installation is successful :)