Regarding Python

Nick Kelley nick at nickkelleystuff.com
Thu Apr 16 18:48:40 EDT 2020


> I need to install python 3.7 or above version, however the previously installed version is python2.7
> I tried many commands
> sudo apt-get install python3.8
> after running the command it fails
> I removed pthon 2.7
> but again when I run the command
> Python --version
> it again shows python 2.7
> please suggest the commands
> I have my python version 3.8 downloaded in the download folder
> 

If you're using apt, "python" usually points to Python 2; try "python3" 
instead. You can also do

$ dpkg -L python3.8

...which will output a list of files installed with the python3.8 
package. If you compare this with your PATH environment variable, you 
should be able to compare which binary is being executed vs. which one 
you want to execute.

You may also want to look into using virtual environments, as using the 
system python often leads to confusion.


More information about the Python-list mailing list