25-07-2021

This commit is contained in:
2021-07-25 13:17:19 +02:00
parent e02b036875
commit 25789f522b
39 changed files with 2593 additions and 121 deletions

View File

@@ -0,0 +1,70 @@
# Python
Python 3 est installé par défaut:
```bash
$ python -V
Python 3.8.8
$ which python
/bin/python
```
<u>pip n'est pas installé par défaut</u>
```bash
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ $ python3 get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Using cached pip-21.1.3-py3-none-any.whl (1.5 MB)
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.8 are installed in '/var/services/homes/bruno/.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.
Successfully installed pip-21.1.3
# Ajouter /volume1/homes/bruno/.local/bin au $PATH
# Utiliser sudo pour une install globale
```
Local installation:
```bash
$ which pip3
/var/services/homes/bruno/.local/bin/pip3
```
Mieux vaut créer un environnement virtuel:
```bash
# Création de l'environnement virtuel
bruno@DS916:~/venv $ python3 -m venv mkdocs
# Activation
bruno@DS916:~/venv $ source mkdocs/bin/activate
# Mise-à-jour de pip et setuptools
(mkdocs) bruno@DS916:~/venv $ pip3 install -U pip setuptools
# Installation de mkdocs
(mkdocs) bruno@DS916:~/venv $ pip3 install -U mkdocs
# Dé-activation
(mkdocs) bruno@DS916:~/venv $ deactivate
$ /var/services/homes/bruno/venv/mkdocs/bin/mkdocs --version
mkdocs, version 1.2.1 from /volume1/homes/bruno/venv/mkdocs/lib/python3.8/site-packages/mkdocs (Python 3.8)
```