Virtualenv: pip install sur macOS venv renvoie SSL CERTIFICATE_VERIFY_FAILED

Créé le 11 oct. 2016  ·  3Commentaires  ·  Source: pypa/virtualenv

En utilisant virtualenv 15.0.3, python 2.7.12, pip 8.1.2, wheel 0.30.0.a0 et setuptools 18.5.

Remarque : Si j'essaie d'installer _sans_ un venv, cela fonctionne, aucun problème SSL. Par conséquent, je voulais vérifier ici au cas où il pourrait y avoir un problème lié à virtualenv .

$ virtualenv tester
Installing setuptools, pip, wheel...done.
$ . tester/bin/activate
(tester) $ cd PROJECT
(tester) $ pip install -e .
Obtaining file:///Users/jdandrea/projects/MyProject
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pbr/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    Couldn't find index page for 'pbr' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    No local packages or working download links found for pbr>=1.8
    Traceback (most recent call last):
    ......

Voir aussi : Le retraçage complet .

virtualenv 14.0.6 aurait résolu un problème SSL concernant les certs . Peut-être s'agit-il d'un problème différent/nouveau ? Incertain.

Commentaire le plus utile

Intéressant. Je viens de découvrir que, si j'installe d'abord pbr manuellement dans le venv, pip install -e . fonctionne sans aucune plainte SSL.

J'ai vérifié cela avec un tout nouveau venv:

# go to project directory
$ pip install -e .
Obtaining file:///Users/jdandrea/projects/myproject
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pbr/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    Couldn't find index page for 'pbr' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    No local packages or working download links found for pbr>=1.8
    Traceback (most recent call last):
    ......
$ pip install pbr>=1.8
$ pip list | grep pbr
pbr (1.10.0)
$ pip install -e
# everything installs, zero errors

J'ai remarqué que tout venait du cache, alors j'ai recréé le venv et essayé une fois de plus, cette fois en utilisant --no-cache-dir .

L'installation a toujours échoué, sauf si j'ai installé pbr @manuellement dans un premier temps :

$ pip install --no-cache-dir 'pbr>=1.8'
Collecting pbr>=1.8
  Downloading pbr-1.10.0-py2.py3-none-any.whl (96kB)
  ......
Installing collected packages: pbr
Successfully installed pbr-1.10.0
$ pip install --no-cache-dir -e .
# everything installs, zero errors

Tous les 3 commentaires

Intéressant. Je viens de découvrir que, si j'installe d'abord pbr manuellement dans le venv, pip install -e . fonctionne sans aucune plainte SSL.

J'ai vérifié cela avec un tout nouveau venv:

# go to project directory
$ pip install -e .
Obtaining file:///Users/jdandrea/projects/myproject
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pbr/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    Couldn't find index page for 'pbr' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) -- Some packages may not be found!
    No local packages or working download links found for pbr>=1.8
    Traceback (most recent call last):
    ......
$ pip install pbr>=1.8
$ pip list | grep pbr
pbr (1.10.0)
$ pip install -e
# everything installs, zero errors

J'ai remarqué que tout venait du cache, alors j'ai recréé le venv et essayé une fois de plus, cette fois en utilisant --no-cache-dir .

L'installation a toujours échoué, sauf si j'ai installé pbr @manuellement dans un premier temps :

$ pip install --no-cache-dir 'pbr>=1.8'
Collecting pbr>=1.8
  Downloading pbr-1.10.0-py2.py3-none-any.whl (96kB)
  ......
Installing collected packages: pbr
Successfully installed pbr-1.10.0
$ pip install --no-cache-dir -e .
# everything installs, zero errors

Problème résolu! Pas un problème de virtualenv.

Comme j'utilise également MacPorts, sudo port install curl-ca-bundle ( voir ce post ) l'a résolu tout de suite.

Donc, il vous suffisait d'installer un véritable ca-bundle dans Python, ou de dire à votre système d'exploitation d'en utiliser un plus récent ?

Cette page vous a été utile?
0 / 5 - 0 notes