Installer pip sur ubuntu 14.04

Résolu/Fermé
Flayme - Modifié le 2 nov. 2022 à 15:58
 Flayme - 4 nov. 2022 à 08:36

Bonjour,

Je voudrais intaller "pip" sur ubuntu 14.04. Quand je fais la commande suivante:

python3 get-pip.py.1

J'obtiens l'erreur suivante:

Traceback (most recent call last):
  File "get-pip.py.1", line 27077, in <module>
    main()
  File "get-pip.py.1", line 135, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py.1", line 111, in bootstrap
    monkeypatch_for_cert(tmpdir)
  File "get-pip.py.1", line 92, in monkeypatch_for_cert
    from pip._internal.commands.install import InstallCommand
zipimport.ZipImportError: can't decompress data; zlib not available

Quand j'essaye d'installer zlib:

sudo apt-get install zlib1g-dev

J'obtiens cette erreur:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package zlib1g-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  zlib1g-dev:i386

E: Package 'zlib1g-dev' has no installation candidate


Merci en avance pour votre aide

Flayme

Linux

A voir également:

3 réponses

Grandasse_ Messages postés 924 Date d'inscription jeudi 28 janvier 2010 Statut Membre Dernière intervention 27 avril 2023 592
25 oct. 2022 à 15:06

Bonjour,

sudo apt update
sudo apt install python3-pip

Puis "pip3 --version" pour vérifier


1

Résultat de :

sudo apt install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pip is already the newest version.

Je pense que ça fait ça car j'ai déjà pip pour python3.4 et python3.5

0
Grandasse_ Messages postés 924 Date d'inscription jeudi 28 janvier 2010 Statut Membre Dernière intervention 27 avril 2023 592 > Flayme
26 oct. 2022 à 13:59

Le sujet c'est une problème d'installation de pip, et finalement c'est déjà sur la machine.

Quel est le problème alors ?

0
Flayme > Grandasse_ Messages postés 924 Date d'inscription jeudi 28 janvier 2010 Statut Membre Dernière intervention 27 avril 2023
27 oct. 2022 à 19:01

Ça:

python3.6 -m pip install pygame
/usr/local/bin/python3.6: No module named pip
pip3 install pygame
bash: /usr/bin/pip3: /usr/bin/python3: bad interpreter: No such file or directory
0
mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024 7 749 > Flayme
2 nov. 2022 à 16:01

Il doit te manquer un lien symbolique :

(mando@silk) (~) $ ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 10 11 août  14:57 /usr/bin/python3 -> python3.10

Pour le créer, en admettant que python3.6 soit ton interpréteur le plus récent :

cd /usr/bin
ls -l python* # Pour voir les versions installées
sudo ln -s python3.6 python

Bonne chance

0
Flayme > mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024
2 nov. 2022 à 17:50

C'est exactement ça mais je n'arrive pas à faire le lien:

ls -l /usr/bin/python3
lrwxrwxrwx 1 root root 17 oct.  23 00:42 /usr/bin/python3 -> usr/bin/python3.4
cd /usr/bin
sudo ln -s python3.6 python
ln: failed to create symbolic link ‘python’: File exists
ls -l python*
lrwxrwxrwx 1 root root       9 déc.  21  2013 python -> python2.7
lrwxrwxrwx 1 root root       9 déc.  21  2013 python2 -> python2.7
-rwxr-xr-x 1 root root 3341256 nov.  13  2018 python2.7
lrwxrwxrwx 1 root root      17 oct.  23 00:42 python3 -> usr/bin/python3.4
-rwxr-xr-x 1 root root 3892168 oct.   9  2013 python3.3
-rwxr-xr-x 1 root root 3892168 oct.   9  2013 python3.3m
-rwxr-xr-x 2 root root 3709816 nov.  13  2018 python3.4
lrwxrwxrwx 1 root root      33 nov.  13  2018 python3.4-config -> x86_64-linux-gnu-python3.4-config
-rwxr-xr-x 2 root root 3709816 nov.  13  2018 python3.4m
lrwxrwxrwx 1 root root      34 nov.  13  2018 python3.4m-config -> x86_64-linux-gnu-python3.4m-config
-rwxr-xr-x 2 root root 4329400 mai   24  2018 python3.5
-rwxr-xr-x 2 root root 4329400 mai   24  2018 python3.5m
lrwxrwxrwx 1 root root      16 mars  23  2014 python3-config -> python3.4-config
lrwxrwxrwx 1 root root      10 mars  23  2014 python3m -> python3.4m
lrwxrwxrwx 1 root root      17 mars  23  2014 python3m-config -> python3.4m-config

-> il ne me met pas qu'il y a python3.6 (pourtant je l'ai bien installer):

python3.6
Python 3.6.0 (default, Oct 22 2022, 16:40:52) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> test = "Hello"
>>> print(f"{test} world")
Hello world

(les "f-strings sont spécifique au version de python supérieur ou égal à 3.6)

C'est peut-être l'endroit où il c'est installé le problème:

which python3.6

/usr/local/bin/python3.6
0
NHenry Messages postés 15113 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 22 avril 2024 331
25 oct. 2022 à 20:57

Juste pour information, Ubuntu 14.04 est en Extended Security Maintenance, bien que encore maintenue, il est fortement recommandé de passer à une version plus récente (22.04 étant la dernière LTS).

Source : https://ubuntu.com/blog/what-is-an-ubuntu-lts-release


0

je sais mais j'ai pas le droit de le faire (pas mon ordi)

0
mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024 7 749 > Flayme
2 nov. 2022 à 16:03

Eh bien tu devrais demander au propriétaire de l'ordinateur de le faire, car son Ubuntu va rapidement devenir (voire, est déjà) complètement inutilisable.

0
Flayme > mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024
2 nov. 2022 à 17:53

Il veut pas.

0
mamiemando Messages postés 33079 Date d'inscription jeudi 12 mai 2005 Statut Modérateur Dernière intervention 23 avril 2024 7 749 > Flayme
2 nov. 2022 à 20:12

Hé bien il ne faut pas qu'il s'étonne d'avoir des problèmes :D

0

J'ai aussi essayé d'installer zlib comme ça.

0