re,
Voici le retour
laurent@Laurent-I7-9900K:~$ /usr/bin/python --version
Python 2.7.17
laurent@Laurent-I7-9900K:~$
laurent@Laurent-I7-9900K:~$ /usr/bin/python2 --version
Python 2.7.17
laurent@Laurent-I7-9900K:~$
laurent@Laurent-I7-9900K:~$ head /home/laurent/Langages/python/2.7.6/Eric-mag/mag_5-3.py
# -*- coding:utf-8 -*-
# python /home/laurent/Langages/python/2.7.6/Eric-mag/mag_5.py
#-----------------------------------------------------------------------------------------------------
# RESTE A FAIRE
#-----------------------------------------------------------------------------------------------------
laurent@Laurent-I7-9900K:~$
laurent@Laurent-I7-9900K:~$ sudo pip install xlwt
[sudo] Mot de passe de laurent :
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: The directory '/home/laurent/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting xlwt
Downloading xlwt-1.3.0-py2.py3-none-any.whl (99 kB)
|████████████████████████████████| 99 kB 897 kB/s
Installing collected packages: xlwt
Successfully installed xlwt-1.3.0
WARNING: You are using pip version 20.2; however, version 20.2.3 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.
laurent@Laurent-I7-9900K:~$ /usr/bin/python2 /home/laurent/Langages/python/2.7.6/Eric-mag/mag_5-3.py
Puis j'ai créer ma basse de données et la table avec phpmyadmin
et la ça fonctionne avec :
/usr/bin/python2 /home/laurent/Langages/python/2.7.6/Eric-mag/mag_5-3.py
Pouvez-vous m'expliquer pourquoi ?
Pourtant j'ai bien de "/usr/bin/python" l'executable de python
/usr/bin/python pointe vers python2.7 ?????
laurent@Laurent-I7-9900K:~$ ls -alh /usr/bin/python*
lrwxrwxrwx 1 root root 9 nov. 28 2019 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root 9 nov. 28 2019 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3,5M juil. 20 17:37 /usr/bin/python2.7
lrwxrwxrwx 1 root root 33 juil. 20 17:37 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root 16 avril 16 2018 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root 9 nov. 28 2019 /usr/bin/python3 -> python3.6
-rwxr-xr-x 2 root root 4,4M juil. 17 14:50 /usr/bin/python3.6
lrwxrwxrwx 1 root root 33 juil. 17 14:50 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config
-rwxr-xr-x 2 root root 4,4M juil. 17 14:50 /usr/bin/python3.6m
lrwxrwxrwx 1 root root 34 juil. 17 14:50 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config
lrwxrwxrwx 1 root root 16 oct. 25 2018 /usr/bin/python3-config -> python3.6-config
lrwxrwxrwx 1 root root 10 nov. 28 2019 /usr/bin/python3m -> python3.6m
lrwxrwxrwx 1 root root 17 oct. 25 2018 /usr/bin/python3m-config -> python3.6m-config
lrwxrwxrwx 1 root root 16 avril 16 2018 /usr/bin/python-config -> python2.7-config
laurent@Laurent-I7-9900K:~$
Merci.