Pyenv: 3.2 l'installation échoue avec une erreur SSL

Créé le 22 mai 2013  ·  23Commentaires  ·  Source: pyenv/pyenv

pyenv install échoue lors de l'installation de 3.2 mais réussit avec 3.2.5 et 3.1.5:

ubuntu<strong i="7">@box144</strong>:~$ pyenv install 3.1.5
Downloading Python-3.1.5.tgz...
-> http://www.python.org/ftp/python/3.1.5/Python-3.1.5.tgz
Installing Python-3.1.5...
Installed Python-3.1.5 to /home/ubuntu/.pyenv/versions/3.1.5

Downloading distribute-0.6.40.tar.gz... [...]
Downloading pip-1.3.1.tar.gz... [...]

ubuntu<strong i="8">@box144</strong>:~$ pyenv install 3.2.5
Downloading Python-3.2.5.tgz...
-> http://yyuu.github.io/pythons/ed8d5529d2aebc36b53f4e0a0c9e6728
Installing Python-3.2.5...
Installed Python-3.2.5 to /home/ubuntu/.pyenv/versions/3.2.5

Downloading distribute-0.6.40.tar.gz... [...]
Downloading pip-1.3.1.tar.gz... [...]

ubuntu<strong i="9">@box144</strong>:~$ pyenv install 3.2
Downloading Python-3.2.tgz...
-> http://yyuu.github.io/pythons/5efe838a7878b170f6728d7e5d7517af
Installing Python-3.2...

BUILD FAILED

Inspect or clean up the working tree at /tmp/python-build.20130522214215.31234
Results logged to /tmp/python-build.20130522214215.31234.log

Last 10 log lines:
  File "<string>", line 2, in <module>
  File "/home/ubuntu/.pyenv/versions/3.2/lib/python3.2/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 4, in <module>
ImportError: The Python ssl extension was not compiled. Missing the OpenSSL lib?
bug

Commentaire le plus utile

Suggère de regarder à nouveau dans ce ticket, n'a pas pu installer de nouveaux pythons avec homebrew installé openssl.

Ran dans exactement le même problème et a trouvé ce ticket:

$ brew upgrade pyenv
Error: pyenv-20140211 already installed
$ pyenv install 2.7.4
....
BUILD FAILED

Inspect or clean up the working tree at /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455
Results logged to /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455.log

Last 10 log lines:
  File "<string>", line 1, in <module>
  File "/Users/doug/.pyenv/versions/2.7.4/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

The Python ssl extension was not compiled. Missing the OpenSSL lib?

Ce qui a fonctionné pour moi:

$ CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install 2.7.4

Tous les 23 commentaires

Cela pourrait être un problème de construction du module ssl avec la version récente d'OpenSSL. J'ai ajouté un correctif dans SHA @ 5fbc3ae3d5629081507b691a3549007cff1cffc6 pour éviter cette erreur.

@notnoop
Veuillez essayer de reconstruire avec le dernier maître.

@notnoop
N'êtes-vous pas là?

Je ferme cela depuis que j'ai confirmé que le problème de construction a été résolu sur ma machine.

J'ai le même problème. Ce n'est pas encore réglé.
J'ai essayé d'installer openssl via homebrew mais le problème persiste.

@Rnhmjoj
Avec quelle version de Python avez-vous rencontré un problème OpenSL? Veuillez me montrer la sortie réelle de pyenv install --verbose ${version} comme essentiel.

@yyuu La version est la version: 3.3.2. Voici le journal .

@Rnhmjoj
hmm ... semble un peu étrange :(

Le problème de construction du module ssl de CPython 3.3.2 doit être un autre problème. Le problème sur CPython 3.2 a été causé par les changements récents d'OpenSSL (il supprime le support de SSLv2).

https://github.com/yyuu/pyenv/blob/master/plugins/python-build/share/python-build/patches/3.2/Python-3.2/001_openssl_no_ssl2.patch

Bien que CPython 3.3.2 soit assez nouveau et qu'un correctif équivalent ait été appliqué par défaut, cela ne doit pas être un problème.

Pour plus d'enquête, j'aimerais avoir un autre problème pour votre problème.

Suggère de regarder à nouveau dans ce ticket, n'a pas pu installer de nouveaux pythons avec homebrew installé openssl.

Ran dans exactement le même problème et a trouvé ce ticket:

$ brew upgrade pyenv
Error: pyenv-20140211 already installed
$ pyenv install 2.7.4
....
BUILD FAILED

Inspect or clean up the working tree at /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455
Results logged to /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455.log

Last 10 log lines:
  File "<string>", line 1, in <module>
  File "/Users/doug/.pyenv/versions/2.7.4/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

The Python ssl extension was not compiled. Missing the OpenSSL lib?

Ce qui a fonctionné pour moi:

$ CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install 2.7.4

J'ai donc mis à jour le fichier 2.7.6 avec les modifications du n ° 22 et j'obtiens toujours la même erreur que le commentaire le plus récent de beck. Est-ce que je manque quelque chose de simple. Sur MacOS Mavericks.
exécutant simplement "pyenv install 2.7.6"

@yina à la fin, j'ai dû abandonner l'openssl homebrew.
Qu'est-ce qui a fonctionné pour moi:

brew uninstall openssl
brew upgrade pyenv
pyenv install 2.7.6

merci beck. Je dois préciser que j'utilise macports pour lequel openssl est installé. J'ai le dernier pyenv avec "pyenv update" avec les modifications que j'ai apportées au fichier 2.7.6.

Ce commit récent semble que openssl sera inclus s'il n'est pas disponible, alors j'essaierais sudo port uninstall openssl . Et si openssl est nécessaire pour d'autres projets, utilisez ce qui est fourni avec xcode. J'espère que cela t'aides

@beck @yina
Le commit 6b0710e263ee92a4ae15822e38b1037775d93609 n'a pas été fusionné dans master . Je me demande si je devrais le fusionner car je peux construire CPython 2.7.6 avec un lien avec OpenSSL 0.9.8 par défaut d'OS X sur OS X Mavericks.

S'il vous plaît laissez-moi savoir plus d'informations:

  1. Avez-vous installé Command Line Tools for Xcode ?
  2. Quel est votre compilateur C par défaut? Vous pouvez le vérifier avec which cc; cc -v
  3. Les variables d'environnement de CFLAGS , LDFLAGS et CPPFLAGS
  4. La sortie de pyenv install -v 2.7.6 2>&1 | tee build.log

@yyuu après vos quelques commentaires, j'ai regardé de plus près mon environnement de construction, stupide je n'ai pas spécifié correctement LDFLAGS et CPPFLAGS donc cela ne fonctionnait pas. J'ai mis à jour les LDFLAGS et CPPFLAGS pour

export LDFLAGS="-L/opt/local/lib" 
export CPPFLAGS="-I/opt/local/include"

puis a couru

pyenv install -v 2.7.6

et ça a marché! Je vous remercie!

: puis:

:toutes nos félicitations:

beck's fix a également fonctionné pour moi mais j'ai utilisé l'openssl de brew
CFLAGS = "- I $ (brew --prefix openssl) / include" \
LDFLAGS = "- L $ (brew --prefix openssl) / lib" \
pyenv installer 2.7.4

Dans Yosemite 10.10.x et homebrew openssl 1.0.2d, j'ai dû changer le oneliner précédent en:
LDFLAGS="-L$(brew --prefix openssl)/lib" CPPFLAGS="-I$(brew --prefix openssl)/include" pyenv install 2.7.10

Il semble que maintenant CPPFLAGS doit être utilisé à la place de CFLAGS.

Pour moi, je devais inclure LDFLAGS et CPPFLAGS pour openssl, zlib et sqlite3.

La commande pour lier zlib et openssl fonctionne pour moi: CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib" CPPFLAGS="-I$(brew --prefix openssl)/include" pyenv install -v 3.5.0

Je viens de passer à El Capitan 10.11.

J'ai aussi ce problème avec ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

J'exécute une installation propre d'El Capitan 10.11 au lieu d'une mise à niveau. J'ai essayé toutes les solutions ci-dessus, la même chose avec le dépannage du wiki et j'obtiens toujours la même erreur.

Voici l'erreur complète (je peux également mettre le journal complet dans l'essentiel si vous le souhaitez):

ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/yyuu/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 10.11 using python-build 20150818)

Inspect or clean up the working tree at /var/folders/0f/z22q_whs0v30pr8lg6b_jfxr0000gn/T/python-build.20151003143338.30855
Results logged to /var/folders/0f/z22q_whs0v30pr8lg6b_jfxr0000gn/T/python-build.20151003143338.30855.log

Last 10 log lines:
rm -f /Users/gabo/.pyenv/versions/2.7.10/share/man/man1/python.1
(cd /Users/gabo/.pyenv/versions/2.7.10/share/man/man1; ln -s python2.1 python.1)
if test "xno" != "xno"  ; then \
        case no in \
            upgrade) ensurepip="--upgrade" ;; \
            install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi

Même erreur avec El Capitan propre ici:

Stefans-MBP:~ stefan$ pyenv install 3.4.3
Downloading readline-6.3.tar.gz...
-> https://yyuu.github.io/pythons/56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43
Installing readline-6.3...
Installed readline-6.3 to /Users/stefan/.pyenv/versions/3.4.3

Downloading Python-3.4.3.tgz...
-> https://yyuu.github.io/pythons/4281ff86778db65892c05151d5de738d
Installing Python-3.4.3...
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/yyuu/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 10.11 using python-build 20150818)

Inspect or clean up the working tree at /var/folders/v5/rk06g5z94txf2fglhrk9b3y40000gn/T/python-build.20151004141807.591
Results logged to /var/folders/v5/rk06g5z94txf2fglhrk9b3y40000gn/T/python-build.20151004141807.591.log

Last 10 log lines:
(cd /Users/stefan/.pyenv/versions/3.4.3/share/man/man1; ln -s python3.4.1 python3.1)
if test "xupgrade" != "xno"  ; then \
        case upgrade in \
            upgrade) ensurepip="--upgrade" ;; \
            install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi
Ignoring ensurepip failure: pip 6.0.8 requires SSL/TLS

@MrLeeh Cela a fonctionné sur El Capitan.

$ xcode-select --install
$ brew uninstall openssl
$ pyenv install 3.4.0

Downloading openssl-1.0.1p.tar.gz...
-> https://yyuu.github.io/pythons/bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1
Installing openssl-1.0.1p...
Installed openssl-1.0.1p to /Users/CHANN/.pyenv/versions/3.4.0

Downloading Python-3.4.0.tgz...
-> https://yyuu.github.io/pythons/d2c83ea0217769a73e8b1ee33ffbca814903f8568e30f8d13e68e3d1f743449c
Installing Python-3.4.0...
Installed Python-3.4.0 to /Users/CHANN/.pyenv/versions/3.4.0

Agréable! Après avoir essayé tout le reste du wiki 'Common build problems', Issues # 448 (bien que n'ayez pas essayé la commande exacte de Copperlight), # 451, le tout sans succès, la solution ci-dessus de channprj a fonctionné pour moi. OS 10.11, El Capitan. Merci!

$ brew désinstaller openssl
$ brew uninstall --force openssl
$ pyenv install 2.7.10

Téléchargement de openssl-1.0.1p.tar.gz ...
-> https://yyuu.github.io/pythons/bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1
Installation de openssl-1.0.1p ...
Openssl-1.0.1p installé dans /Users/tylerarbour/.pyenv/versions/2.7.10

Téléchargement de Python-2.7.10.tgz ...
-> https://yyuu.github.io/pythons/eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a
Installation de Python-2.7.10 ...
fichier de correctif ./Lib/site.py
Python-2.7.10 installé dans /Users/tylerarbour/.pyenv/versions/2.7.10

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