Views: 911
Dans cet exemple, nous allons passer de Python 2.7.16 par défaut à Python 3.8.2.
1. Vérifier les versions
python --version
python3 --version
![](https://mikadmin.fr/blog/wp-content/uploads/2020/11/Screenshot_2.png)
2. Changement de la version par défaut
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
Si l’erreur ci-dessous survient, il nous faut donc récupérer le path de python3 et le changer dans la commande :
![](https://mikadmin.fr/blog/wp-content/uploads/2020/11/Screenshot_3-1.png)
Récupération du path :
![](https://mikadmin.fr/blog/wp-content/uploads/2020/11/Screenshot_4.png)
Nouvelle commande avec le bon path :
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3 1
![](https://mikadmin.fr/blog/wp-content/uploads/2020/11/Screenshot_5-1024x46.png)
3. Vérification
python --version
![](https://mikadmin.fr/blog/wp-content/uploads/2020/11/Screenshot_6.png)
😃 🤟 👍
Pourquoi devrais-je changer la version de python ?