GNU/Linux >> Tutoriels Linux >  >> Debian

Installer Python 3.7 sur Debian 9

Python est un langage polyvalent utilisé pour l’automatisation, le développement web, l’analyse de données et l’apprentissage automatique. Debian 9 ne fournit pas Python 3.7 par défaut, il faut donc le compiler depuis les sources.

Installer les dépendances de compilation

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev

Télécharger Python 3.7

curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar -xf Python-3.7.3.tar.xz

Configurer et compiler

cd Python-3.7.3
./configure --enable-optimizations
make -j 8

La valeur de -j peut être ajustée selon le nombre de cœurs CPU, vérifiable avec nproc.

Installer Python

Utilisez altinstall pour ne pas remplacer le Python système :

sudo make altinstall
python3.7 --version
Debian
  1. Installer Python 3.8 sur Debian 11 Bullseye depuis les sources

  2. Installer Python 3.9 sur Debian 11 Bullseye et créer un venv

  3. Installer Python 3.6 sur Debian Jessie

  4. Comment installer Python 3.6.4 sur Debian 9

  5. Installer Python 3.10 sur Debian 11

Installer Python 3.9 sur Debian 11

Installer Python 3.10 sur Debian 11 sans casser l'interpréteur système

Installer Python 3.7 sur Debian 11 Bullseye

Installer Python 3 sur Debian 8

Comment installer Python 3.7 sur Debian 9 Stretch

Installer Go sur Debian 10