Pyenv: 3.2 la instalación falla con error SSL

Creado en 22 may. 2013  ·  23Comentarios  ·  Fuente: pyenv/pyenv

pyenv install comando

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

Comentario más útil

Sugiero mirar este ticket una vez más, no se pudieron instalar nuevas pitones con opensl instalado homebrew.

Me encontré exactamente con el mismo problema y encontré este boleto:

$ 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?

Lo que funcionó para mí:

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

Todos 23 comentarios

Esto podría ser un problema de compilación del módulo ssl con una versión reciente de OpenSSL. Agregué un parche en

@notnoop
Intente reconstruir con el último maestro.

@notnoop
¿No estás ahí?

Cierro esto porque he confirmado que el problema de compilación se ha solucionado en mi máquina.

Tengo el mismo problema. Aún no está arreglado.
Intenté instalar openssl a través de homebrew pero el problema persiste.

@Rnhmjoj
¿Con qué versión de Python conociste el problema de openssl? Por favor muéstreme la salida real de pyenv install --verbose ${version} como esencia.

@yyuu La versión es la versión: 3.3.2. Aquí está el registro .

@Rnhmjoj
hmm ... se ve algo extraño :(

El problema de compilación del módulo ssl de CPython 3.3.2 debe ser otro problema. El problema en CPython 3.2 fue causado por los cambios recientes en OpenSSL (elimina el soporte para 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

Aunque CPython 3.3.2 es bastante nuevo y se ha aplicado una solución equivalente por defecto, esto no debe ser un problema.

Para investigar más, me gustaría tener otro problema para su problema.

Sugiero mirar este ticket una vez más, no se pudieron instalar nuevas pitones con opensl instalado homebrew.

Me encontré exactamente con el mismo problema y encontré este boleto:

$ 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?

Lo que funcionó para mí:

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

Así que actualicé el archivo 2.7.6 con los cambios en el n. ° 22 y sigo recibiendo el mismo error que el comentario más reciente de beck. ¿Me estoy perdiendo algo simple? En MacOS Mavericks.
simplemente ejecutando "pyenv install 2.7.6"

@yina al final tuve que
Lo que terminó funcionando para mí:

brew uninstall openssl
brew upgrade pyenv
pyenv install 2.7.6

gracias beck. Debo aclarar que estoy usando macports para los que está instalado openssl. Tengo la última pyenv con "actualización de pyenv" con los cambios que hice en el archivo 2.7.6.

Esta confirmación reciente parece que se incluirá openssl si no está disponible, por lo que probaría sudo port uninstall openssl . Y si se necesita openssl para otros proyectos, use lo que se entrega con xcode. Espero que esto ayude

@beck @yina
La confirmación 6b0710e263ee92a4ae15822e38b1037775d93609 no se ha fusionado en master . Me pregunto si debería fusionarlo, ya que puedo construir CPython 2.7.6 con vinculación con el OpenSSL 0.9.8 predeterminado de OS X en OS X Mavericks.

Por favor déjeme saber más información:

  1. ¿Tiene Command Line Tools for Xcode instalado?
  2. ¿Cuál es su compilador de C predeterminado? Puedes comprobarlo con which cc; cc -v
  3. Las variables de entorno de CFLAGS , LDFLAGS y CPPFLAGS
  4. La salida de pyenv install -v 2.7.6 2>&1 | tee build.log

@yyuu después de sus pocos comentarios miré más de cerca sobre mi entorno de compilación, tonto, no especifiqué LDFLAGS y CPPFLAGS correctamente, por lo que no estaba funcionando. Actualicé LDFLAGS y CPPFLAGS a

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

y luego corrió

pyenv install -v 2.7.6

¡Y funcionó! ¡gracias!

: luego:

:Felicidades:

la solución de beck también funcionó para mí, pero usé openssl de brew
CFLAGS = "- I $ (brew --prefix openssl) / include" \
LDFLAGS = "- L $ (brew --prefix openssl) / lib" \
pyenv install 2.7.4

En Yosemite 10.10.xy homebrew openssl 1.0.2d, tuve que cambiar el delineador anterior a:
LDFLAGS="-L$(brew --prefix openssl)/lib" CPPFLAGS="-I$(brew --prefix openssl)/include" pyenv install 2.7.10

Parece que ahora se debe utilizar CPPFLAGS en lugar de CFLAGS.

Para mí, tuve que incluir LDFLAGS y CPPFLAGS para openssl, zlib y sqlite3.

El comando para vincular zlib y openssl funciona para mí: 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

Acabo de actualizar a El Capitan 10.11.

También tengo este problema con ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Estoy ejecutando una instalación limpia de El Capitan 10.11 en lugar de una actualización. Probé todas las soluciones anteriores, lo mismo con la resolución de problemas de wiki y sigo obteniendo el mismo error.

Aquí está el error completo (también puedo poner el registro completo en un resumen si lo desea):

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

El mismo error con limpiar El Capitán aquí:

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 Funcionó en El Capitán.

$ 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

¡Agradable! Después de probar todo lo demás de la wiki 'Problemas comunes de compilación', Problemas # 448 (aunque no probé el comando exacto de Copperlight), # 451, todo sin éxito, la solución anterior de channprj funcionó para mí. OS 10.11, El Capitán. ¡Gracias!

$ brew desinstalar openssl
$ brew desinstalar --force openssl
$ pyenv instalar 2.7.10

Descargando openssl-1.0.1p.tar.gz ...
-> https://yyuu.github.io/pythons/bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1
Instalando openssl-1.0.1p ...
Openssl-1.0.1p instalado en /Users/tylerarbour/.pyenv/versions/2.7.10

Descargando Python-2.7.10.tgz ...
-> https://yyuu.github.io/pythons/eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a
Instalación de Python-2.7.10 ...
archivo de parcheo ./Lib/site.py
Python-2.7.10 instalado en /Users/tylerarbour/.pyenv/versions/2.7.10

¿Fue útil esta página
0 / 5 - 0 calificaciones