I have now installed Python 3.9, and have now replaced Python 3.8.
Running Terminal shows that Python 3.9 is being used:
I have now installed Python 3.9, and have now replaced Python 3.8.
Running Terminal shows that Python 3.9 is being used:
I would be careful about removing Python3.8 in case it's being used by systems where your Python 3.9 install won't work. I'd be particularly careful in this specific case since python3.9 doesn't seem to be in the ubuntu 18.4 apt repo, so I'm assuming you installed it from elsewhere.
In this case, did your python install go into a different directory? Perhaps you could set it up such that this other one be used by putting the other directory before /usr/bin in your $PATH.
If you're determined to uninstall python 3.8, I'd start by temporarily making it unavailable (such as using chmod 0, or renaming it to something that you can easily back), and make sure your system doesn't do any funny stuff. In particular I'd make sure that your computer continues to boot after a restart. Once you're sure, you can do an apt-get remove.
Also, a general good practice, but a particularly good one if you have more than one python interpreter installed, is when installing packages to use python -m pip
rather than just pip
.
Since you have conda
installed, you can create a conda
environment that is purely python 3.9.
(base) conda create --name py39 python=3.9
(base) conda activate py39
Note that you can install specific packages for this environment in the first command. For example, add numpy
after the 3.9 to include interactive python (conda create --name py39 python=3.9 numpy
). You will see that you are no longer using base
but py39
environment. If you need to switch to python 3.8, you can deactivate
(py39) conda deactivate
This page can be helpful as it explains environments in details: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html