Regarding Python

Bev In TX countryone77 at gmail.com
Fri Apr 17 04:46:01 EDT 2020



Bev

> On Apr 16, 2020, at 5:36 PM, Muneer Malla <mallamuneer123 at gmail.com> wrote:
> ... potion snipped ...
> 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 
What failed?  Did the apt-get command fail, or were you unable to run Python 3.8?

> I removed pthon 2.7 
> but again when I run the command 
> Python --version 
> it again shows python 2.7
If it were me, I would not remove Python 2.7, as on some older Linux versions, it may still be used by the system.  Perhaps that’s why you were unable to get rid of it.

> please suggest the commands 
> I have my python version 3.8 downloaded in the download folder

Python 2 and Python 3 can happily coexist on the same Linux system.  If both are installed, running “python” will invoke version 2.x, while running “python3” will invoke version 3.x (without the quotes).  

If for some reason you must run Python 3 with the “python” command on systems with both Python 2 and 3, then set up a virtual environment and source into it before running Python 3.
https://docs.python.org/3/tutorial/venv.html
https://docs.python.org/3/library/venv.html?highlight=venv

Bev in TX




More information about the Python-list mailing list