Install Python on Ubuntu
-
I am trying to install Python 3.9 on my Ubuntu OS, I try to install Python in the following manner
sudo apt-get install python3.9
after seems installed I tried checking the version:
python -V
However, this input returns:
-bash: python: command not found
It seems like Python versions don't fully install.
Can anyone help me for installation Python on Ubuntu? -
@Gulshan-Negi
It certainly used to be the case that under Ubuntu/Linux generallypython
attempts to run Python 2.x. To run Python 3.x you are/were supposed to typepython3
? -
This post is deleted!
-
@Gulshan-Negi
I don't really know why you needed to do anything. Ubuntu 20.04+ comes with Python 3 already installed.... -
Currently python is by default python2. To ensure you are getting the Python 3 interpreter call python3.
As for having different versions of python on your system, I would recommend using either virtualenv or conda to manage them rather than system installation. This will allow you to work in isolated environments tailored to the needs of your projects.
-
To run Python 3.x you are/were supposed to type python3
-
alternatives is a front end for simply replacing the /usr/bin symlinks. You can make /usr/bin/python point to whatever version you have installed. I'm in upgrade to python3 hell at the moment because I installed debian 11 on my newest workstation and I need to make it backward compatible with bunches of NFS shared python2 programs I run interchangably on other machines. of course many of those apps use python2 specific modules that aren't available in debian11.
-
This post is deleted!
-
This post is deleted!