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?
Este pode ser um problema de construção do módulo SSL com a versão recente do OpenSSL. Eu adicionei o patch no SHA @ 5fbc3ae3d5629081507b691a3549007cff1cffc6 para evitar esse erro.
@notnoop
Tente reconstruir com o mestre mais recente.
@notnoop
Você não está aí?
Eu fecho isso porque confirmei que o problema de compilação foi corrigido em minha máquina.
Eu tenho o mesmo problema. Ainda não foi corrigido.
Tentei instalar o openssl via homebrew, mas o problema persiste.
@Rnhmjoj
Com qual versão do Python você encontrou problemas com o openssl? Por favor, mostre-me o resultado real de pyenv install --verbose ${version}
como essência.
@yyuu A versão é a versão: 3.3.2. Aqui está o log .
@Rnhmjoj
hmm ... parece um pouco estranho :(
O problema de compilação do módulo ssl
do CPython 3.3.2 deve ser outro problema. O problema no CPython 3.2 foi causado pelas mudanças recentes no OpenSSL (ele descarta o suporte para SSLv2).
Embora o CPython 3.3.2 seja bastante novo e uma correção equivalente tenha sido aplicada por padrão, isso não deve ser um problema.
Para mais investigação, gostaria de ter outro problema para o seu problema.
Sugiro examinar este tíquete mais uma vez, não foi possível instalar novos pythons com o Homebrew instalado.
Encontrou exatamente o mesmo problema e encontrei este tíquete:
$ 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?
O que funcionou para mim:
$ CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install 2.7.4
Portanto, atualizei o arquivo 2.7.6 com as alterações no item 22 e ainda recebo o mesmo erro do comentário mais recente de beck. Estou perdendo algo simples. No MacOS Mavericks.
apenas executando "pyenv install 2.7.6"
No final,
O que acabou funcionando para mim:
brew uninstall openssl
brew upgrade pyenv
pyenv install 2.7.6
obrigado beck. Devo esclarecer que estou usando macports para o qual o openssl está instalado. Eu tenho o pyenv mais recente com "atualização do pyenv" com as alterações que fiz no arquivo 2.7.6.
Este commit recente parece que o openssl será incluído se não estiver disponível, então eu tentaria sudo port uninstall openssl
. E se o openssl for necessário para outros projetos, use o que é fornecido com o xcode. Espero que isto ajude
@beck @yina
O commit 6b0710e263ee92a4ae15822e38b1037775d93609 não foi mesclado em master
. Eu me pergunto se devo mesclá-lo, já que posso construir o CPython 2.7.6 com vinculação ao OpenSSL 0.9.8 padrão do OS X no OS X Mavericks.
Por favor, deixe-me saber mais informações:
Command Line Tools for Xcode
instalado?which cc; cc -v
CFLAGS
, LDFLAGS
e CPPFLAGS
pyenv install -v 2.7.6 2>&1 | tee build.log
@yyuu após seus poucos comentários eu olhei mais de perto sobre meu ambiente de compilação, burro eu não especifiquei LDFLAGS e CPPFLAGS corretamente então não estava funcionando. Atualizei o LDFLAGS e CPPFLAGS para
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"
e então correu
pyenv install -v 2.7.6
e funcionou! obrigado!
: então:
:Parabéns:
A correção de Beck também funcionou para mim, mas usei o Brew's OpenSl
CFLAGS = "- I $ (brew --prefix openssl) / incluir" \
LDFLAGS = "- L $ (brew --prefix openssl) / lib" \
pyenv install 2.7.4
No Yosemite 10.10.xe no homebrew openssl 1.0.2d, tive que alterar o oneliner anterior para:
LDFLAGS="-L$(brew --prefix openssl)/lib" CPPFLAGS="-I$(brew --prefix openssl)/include" pyenv install 2.7.10
Parece que agora CPPFLAGS deve ser usado em vez de CFLAGS.
Para mim, tive que incluir LDFLAGS e CPPFLAGS para openssl, zlib e sqlite3.
O comando para vincular zlib e openssl funciona para mim: 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
Acabei de atualizar para o El Capitan 10.11.
Também estou tendo este problema com ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Estou executando uma instalação limpa do El Capitan 10.11 em vez de uma atualização. Eu tentei todas as soluções acima, o mesmo com a solução de problemas do wiki e ainda obtenho o mesmo erro.
Aqui está o erro completo (também posso incluir o log completo em uma essência, se desejar):
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
O mesmo erro com limpar El Capitan aqui:
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 Funcionou no 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
Agradável! Depois de tentar todo o resto do wiki 'Problemas comuns de compilação', Problemas # 448 (embora não tenha tentado o comando exato do copperlight), # 451, tudo sem sucesso, a solução acima do channprj funcionou para mim. OS 10.11, El Capitan. Obrigado!
$ brew uninstall openssl
$ brew uninstall --force openssl
$ pyenv install 2.7.10
Baixando openssl-1.0.1p.tar.gz ...
-> https://yyuu.github.io/pythons/bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1
Instalando o openssl-1.0.1p ...
Opensl-1.0.1p instalado em /Users/tylerarbour/.pyenv/versions/2.7.10
Baixando Python-2.7.10.tgz ...
-> https://yyuu.github.io/pythons/eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a
Instalando Python-2.7.10 ...
arquivo de patch ./Lib/site.py
Python-2.7.10 instalado em /Users/tylerarbour/.pyenv/versions/2.7.10
Comentários muito úteis
Sugiro examinar este tíquete mais uma vez, não foi possível instalar novos pythons com o Homebrew instalado.
Encontrou exatamente o mesmo problema e encontrei este tíquete:
O que funcionou para mim: