J
J
jundevtut2018-06-28 19:07:15
linux
jundevtut, 2018-06-28 19:07:15

How to install Python 3.7 on Ubuntu?

Hello, the question arose of how best to install Python 3.7, pip on Ubuntu (16.04) and possibly separate it all from the system. Until today, I have used everything from the office. repositories. And then constantly something broke, for example, when updating Pip for example. (This is probably my hands are not from the same place). I tried to find something detailed on the Internet, but I did not find something sensible.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
warnabas, 2018-10-20
@warnabas

#apt update && apt upgrade -y
Next, we put all the dependencies

#apt install build-essential -y
#apt install libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev -y

For debian users, you need to install zlib.
Download the archive, unpack it, configure it, etc.
#cd /usr/src
#wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
#tar -xzvf Python-3.7.0.tgz
#cd Python-3.7.0
#./configure --enable-optimizations
#make altinstall

last, in order not to replace anything in /usr/bin
, it is advised to install venv further, it comes by default from Python 3.3. it is better to do the following command somewhere in the project or where you will place this venv
to activate venv
then you can check the version of python python --version

E
EmachinesDIMA, 2018-07-18
@EmachinesDIMA

Note if Debian is installed - it does not support Python 3.7 out of the box, as it is not stable.
do this:
$ sudo nano /etc/apt/sources.list
# add
deb ftp.de.debian.org/debian testing main
$ echo 'APT::Default-Release "stable";' | sudo tee -a /etc/apt/apt.conf.d/00local
$ sudo apt-get update
$ sudo apt-get -t testing install python3.7
$ python3.7 -V
## which - search for
which python3 is installed. 7
## alias
alias python=/usr/bin/python3.7
in ubuntu
apt install python3.7

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question