142 votes

problème de pip pour installer presque toutes les bibliothèques

J'ai du mal à utiliser pip pour installer presque tout. Je suis nouveau dans le codage, alors j'ai pensé que c'était peut-être quelque chose que je faisais mal et j'ai opté pour easy_install pour obtenir la plupart de ce dont j'avais besoin, ce qui a généralement fonctionné. Cependant, maintenant j'essaie de télécharger la bibliothèque nltk, et aucun des deux n'arrive à faire le travail.

J'ai essayé d'entrer

sudo pip install nltk

mais a obtenu la réponse suivante :

/Library/Frameworks/Python.framework/Versions/2.7/bin/pip run on Sat May  4 00:15:38 2013
Downloading/unpacking nltk

  Getting page https://pypi.python.org/simple/nltk/
  Could not fetch URL [need more reputation to post link]: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>

  Will skip URL [need more reputation to post link]/simple/nltk/ when looking for download links for nltk

  Getting page [need more reputation to post link]/simple/
  Could not fetch URL https://pypi.python. org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>

  Will skip URL [need more reputation to post link] when looking for download links for nltk

  Cannot fetch index base URL [need more reputation to post link]

  URLs to search for versions for nltk:
  * [need more reputation to post link]
  Getting page [need more reputation to post link]
  Could not fetch URL [need more reputation to post link]: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>

  Will skip URL [need more reputation to post link] when looking for download links for nltk

  Could not find any downloads that satisfy the requirement nltk

No distributions at all found for nltk

Exception information:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/index.py", line 171, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for nltk

--easy_install installed fragments of the library and the code ran into trouble very quickly upon trying to run it.

Des idées sur cette question ? J'apprécierais vraiment un retour sur la façon dont je peux soit faire fonctionner pip, soit contourner le problème en attendant.

8voto

Ruben Points 301

J'ai résolu un problème similaire en ajoutant le --trusted-host pypi.python.org option

7voto

Jianzhe Gu Points 71

Pour installer n'importe quel autre paquet, je dois utiliser la dernière version de pip, puisque le fichier 9.0.1 a ce problème de SSL. Pour mettre à jour le pip par le pip lui-même, je dois d'abord résoudre ce problème SSL. Pour sortir de cette boucle sans fin, j'ai trouvé le seul moyen qui fonctionne pour moi.

  1. Trouvez la dernière version de pip dans cette page : https://pypi.org/simple/pip/
  2. Télécharger le .whl de la dernière version.
  3. Utilisez pip pour installer la dernière version de pip. (Utilisez votre propre dernière version ici)

sudo pip install pip-10.0.1-py2.py3-none-any.whl

Maintenant le pip est la dernière version et peut installer n'importe quoi.

3voto

apatsekin Points 379

MacOS Sierra 10.12.6. Je n'ai pas pu installer quoi que ce soit via pip (python installé via homebrew). Toutes les réponses ci-dessus n'ont pas fonctionné.

Finalement, la mise à niveau de python 3.5 à 3.6 a fonctionné.

brew update
brew doctor #(in case you see such suggestion by brew)

puis suivez toutes les suggestions supplémentaires de brew, c'est-à-dire écrasez le lien vers python.

3voto

Günay Gültekin Points 425

J'ai eu le même problème. Je viens de mettre à jour le python de 2.7.0 a 2.7.15 . Il résout le problème.

Vous pouvez télécharger ici .

3voto

blackjar Points 21

A essayé

pip --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org install xxx 

et enfin travaillé, pas tout à fait comprendre pourquoi le domaine pypi.python.org est changé.

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X