When I install python3.9 or 3.10, there is no change in python3 command. It is still python3.8.10 and all packages will be installed for 3.8.10 unless I run a python3.9 -m pip. What is the reason that you cannot change python3 version to a newer one?
Asked
Active
Viewed 1,058 times
1 Answers
-1
The reason you cannot change python3 to a newer default version is because it would break the operating system and many applications that depend on the default version of python3. You can, however, use an alias so that, when you run the python command in the terminal, python3.9 will execute.
Open the bashrc file by using the following command:
nano ~/.bashrc
Add the following line to the below of the bashrc file .
alias python3='/usr/bin/python3.9'
After you save the file, run the following command to apply the changes:
. ~/.bashrc