Rather than building from source or using packages from different Ubuntu versions I would recommend using the Deadsnakes PPA. This provides both newer and older versions of Python than are in the Ubuntu archive, and keeps those versions up to date with bugfix releases.
Answer from dom1310df on askubuntu.comI need to use python 3.7 but Ubuntu 20.4 comes with 3.8 pre-installed - can I install it with apt-get alongside 3.8?
how to install python 3.7 on ubuntu 21.04? thx
Help with installing python 3.7
When can we expect Python 3.10 in Anaconda?
It was added to the conda-forge channel 7 hours ago. You can install it with
conda install -c conda-forge python=3.10More on reddit.com
Videos
Rather than building from source or using packages from different Ubuntu versions I would recommend using the Deadsnakes PPA. This provides both newer and older versions of Python than are in the Ubuntu archive, and keeps those versions up to date with bugfix releases.
In Ubuntu 20.04, you will get bydefault Python 3.8 version. If you want to install Python 3.7, you can download python 3.7 tarball file and install it.
tar -xvzf Python-3.7.7.tgz
pip install .
python setup.py install
Sorry for the dumb question. Just installed a fresh Ubuntu 20.4 after a couple of years of not touching Linux. I thought I could just sudo apt-get install python3.7 but that doesn't work.
I'd love to be able to use apt-get to minimize the chances I fuck something up, can I do this without having to download and compile it myself?
More specifically:
When I sudo apt-get install python 3.7 I don't get any errors or anything, I just get the following:
$ sudo apt-get install python3.7 [sudo] password for j: Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python3.7-2to3' for regex 'python3.7' Note, selecting 'libpython3.7-stdlib' for regex 'python3.7' 0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Then when I python3.7 I get:
$ python3.7 Command 'python3.7' not found, did you mean: command 'python2.7' from deb python2.7 (2.7.18~rc1-2) command 'python3.8' from deb python3.8 (3.8.2-1ubuntu1.1) Try: sudo apt install <deb name>
And if I look in /usr/bin/:
$ ls /usr/bin/ | grep python python3 python3.8
And:
$ ls -l /usr/bin/python* lrwxrwxrwx 1 root root 9 júl 8 23:57 /usr/bin/python3 -> python3.8 -rwxr-xr-x 1 root root 5457536 apr 27 15:53 /usr/bin/python3.8
First, install some dependencies:
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Then download using the following command:
version=2.7.13
cd ~/Downloads/
wget https://www.python.org/ftp/python/$version/Python-$version.tgz
Extract and go to the directory:
tar -xvf Python-$version.tgz
cd Python-$version
Now, install using the command you just tried, using checkinstall instead to make it easier to uninstall if needed:
./configure
make
sudo checkinstall
Change version to whichever version you need (version=2.7.1 or version=3.6.0, for example).
Unless you really have a burning desire to compile it yourself, the preferred way is to use the DeadSnakes PPA to install versions of Python that aren't included by default:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python2.7
Other versions, such as python2.4 or python3.6, etc. are also available.
how to install python 3.7 on ubuntu 21.04? thx
I am on a raspberry pi if that makes a difference. I’d like to install python 3.7 ideally so my projects can work. I’ve googled it and sudo apt-get install python3.7 doesn’t work and I see some other meathods but it involves installing other things and I’m not exactly sure what those things are or do