Outils pour utilisateurs

Outils du site


lancer_correctement_python

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révisionLes deux révisions suivantes
lancer_correctement_python [2021/02/24 17:46] – [Ce qu'il faut retenir par cœur] sergelancer_correctement_python [2021/02/24 17:54] – [Ce qu'il faut retenir par cœur] serge
Ligne 30: Ligne 30:
   * **[[https://docs.python.org/fr/3/tutorial/index.html|Le tutoriel Python]]** de la fondation Python fr.   * **[[https://docs.python.org/fr/3/tutorial/index.html|Le tutoriel Python]]** de la fondation Python fr.
 =====Ce qu'il faut retenir par cœur===== =====Ce qu'il faut retenir par cœur=====
 +
 +====Installer un package====
  
   python3.7 -m pip install black --user    python3.7 -m pip install black --user 
 +  
 +Pour lancer un script:
 +
   python3.7 -m mon_fichier.py   python3.7 -m mon_fichier.py
  
 +====Mettre à jour pip====
 +  
 +  python3.7 -m pip install --upgrade pip
 +  
 +    WARNING: The scripts pip, pip3 and pip3.7 are installed in '/home/toto/.local/bin' which is not on PATH.
 +  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
 +  
 +Ajouter au fichier ~/.bashrc
 +
 +  # Pour pip, pip3 and pip3.7
 +  export PYTHONPATH="${PYTHONPATH}:/home/toto/.local/bin"
 +  
 =====VirtualEnv===== =====VirtualEnv=====