Pyenv: 3.2 Installation schlägt mit SSL-Fehler fehl

Erstellt am 22. Mai 2013  ·  23Kommentare  ·  Quelle: pyenv/pyenv

pyenv install Befehl

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

Hilfreichster Kommentar

Schlagen Sie vor, noch einmal in dieses Ticket zu schauen. Es war nicht möglich, neue Pythons mit installiertem Homebrew zu installieren.

Stieß genau auf das gleiche Problem und fand dieses 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?

Was hat bei mir funktioniert:

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

Alle 23 Kommentare

Dies könnte ein Build-Problem des SSL-Moduls mit der neuesten Version von OpenSSL sein. Ich habe einen Patch in SHA @ 5fbc3ae3d5629081507b691a3549007cff1cffc6 hinzugefügt , um diesen Fehler zu verhindern.

@notnoop
Bitte versuchen Sie es mit dem neuesten Master.

@notnoop
Bist du nicht da?

Ich schließe dies, da ich bestätigt habe, dass das Build-Problem auf meinem Computer behoben wurde.

Ich habe das gleiche Problem. Es ist noch nicht behoben.
Ich habe versucht, openssl über Homebrew zu installieren, aber das Problem besteht weiterhin.

@ Rnhmjoj
Mit welcher Version von Python haben Sie ein OpenSSL-Problem festgestellt? Bitte zeigen Sie mir die tatsächliche Ausgabe von pyenv install --verbose ${version} als Kern.

@yyuu Die Version ist Version: 3.3.2. Hier ist das Protokoll .

@ Rnhmjoj
hmm ... sieht etwas seltsam aus :(

Das Build-Problem des Moduls ssl von CPython 3.3.2 muss ein weiteres Problem sein. Das Problem unter CPython 3.2 wurde durch die jüngsten Änderungen in OpenSSL verursacht (die Unterstützung für SSLv2 wird eingestellt).

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

Obwohl CPython 3.3.2 ziemlich neu ist und standardmäßig ein gleichwertiger Fix angewendet wurde, darf dies kein Problem sein.

Für weitere Untersuchungen hätte ich gerne ein anderes Problem für Ihr Problem.

Schlagen Sie vor, noch einmal in dieses Ticket zu schauen. Es war nicht möglich, neue Pythons mit installiertem Homebrew zu installieren.

Stieß genau auf das gleiche Problem und fand dieses 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?

Was hat bei mir funktioniert:

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

Also habe ich die 2.7.6-Datei mit den Änderungen in # 22 aktualisiert und erhalte immer noch den gleichen Fehler wie der letzte Kommentar von beck. Vermisse ich etwas Einfaches? Auf MacOS Mavericks.
läuft gerade "pyenv install 2.7.6"

@yina am ende musste ich das homebrew openssl fallen lassen.
Was hat bei mir funktioniert:

brew uninstall openssl
brew upgrade pyenv
pyenv install 2.7.6

danke beck. Ich sollte klarstellen, dass ich Macports verwende, für die openssl installiert ist. Ich habe das neueste pyenv mit "pyenv update" mit den Änderungen, die ich an der 2.7.6-Datei vorgenommen habe.

Dieses letzte Commit sieht so aus, als ob openssl enthalten sein wird, wenn es nicht verfügbar ist, also würde ich sudo port uninstall openssl versuchen. Und wenn openssl für andere Projekte benötigt wird, verwenden Sie das, was mit xcode geliefert wird. Hoffe das hilft

@beck @yina
Das Commit 6b0710e263ee92a4ae15822e38b1037775d93609 wurde nicht in master . Ich frage mich, ob ich es zusammenführen sollte, da ich CPython 2.7.6 mit Verknüpfung mit OS Xs Standard OpenSSL 0.9.8 unter OS X Mavericks erstellen kann.

Bitte lassen Sie mich weitere Informationen wissen:

  1. Haben Sie Command Line Tools for Xcode installiert?
  2. Was ist Ihr Standard-C-Compiler? Sie können es mit which cc; cc -v überprüfen
  3. Die Umgebungsvariablen CFLAGS , LDFLAGS und CPPFLAGS
  4. Die Ausgabe von pyenv install -v 2.7.6 2>&1 | tee build.log

@yyuu nach deinen wenigen Kommentaren habe ich mir meine Build-Umgebung genauer angesehen, dumm, dass ich die LDFLAGS und CPPFLAGS nicht richtig angegeben habe, also hat es nicht funktioniert. Ich habe die LDFLAGS und CPPFLAGS auf aktualisiert

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

und rannte dann

pyenv install -v 2.7.6

und es hat funktioniert! Dankeschön!

: dann:

:Herzliche Glückwünsche:

Beck's Fix hat auch bei mir funktioniert, aber ich habe Brews OpenSL verwendet
CFLAGS = "- I $ (Brew - Präfix openssl) / include" \
LDFLAGS = "- L $ (Brew - Präfix openssl) / lib" \
pyenv install 2.7.4

In Yosemite 10.10.x und Homebrew OpenSSL 1.0.2d musste ich den vorherigen Oneliner ändern in:
LDFLAGS="-L$(brew --prefix openssl)/lib" CPPFLAGS="-I$(brew --prefix openssl)/include" pyenv install 2.7.10

Es scheint, dass jetzt CPPFLAGS anstelle von CFLAGS verwendet werden muss.

Für mich musste ich LDFLAGS und CPPFLAGS für openssl, zlib und sqlite3 einbinden.

Der Befehl zum Verknüpfen von zlib und openssl funktioniert für mich: 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

Ich habe gerade ein Upgrade auf El Capitan 10.11 durchgeführt.

Ich habe auch dieses Problem mit ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Ich führe eine Neuinstallation von El Capitan 10.11 anstelle eines Upgrades durch. Ich habe alle oben genannten Lösungen ausprobiert, die gleichen wie bei der Wiki-Fehlerbehebung, und erhalte immer noch den gleichen Fehler.

Hier ist der vollständige Fehler (ich kann auch das vollständige Protokoll in eine Liste einfügen, wenn Sie möchten):

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

Gleicher Fehler mit sauberem El Capitan hier:

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 Es hat auf El Capitan funktioniert.

$ 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

Nett! Nachdem ich alles andere aus dem Wiki 'Common Build Problems', Issues # 448 (obwohl ich den genauen Befehl von Copperlight nicht ausprobiert hatte), # 451 ausprobiert hatte, alles ohne Erfolg, funktionierte die obige Lösung von channprj für mich. OS 10.11, El Capitan. Vielen Dank!

$ Brew deinstallieren openssl
$ Brew deinstallieren --force openssl
$ pyenv install 2.7.10

Herunterladen openssl-1.0.1p.tar.gz ...
-> https://yyuu.github.io/pythons/bd5ee6803165c0fb60bbecbacacf244f1f90d2aa0d71353af610c29121e9b2f1
Installation von openssl-1.0.1p ...
Installiert openssl-1.0.1p unter /Users/tylerarbour/.pyenv/versions/2.7.10

Herunterladen von Python-2.7.10.tgz ...
-> https://yyuu.github.io/pythons/eda8ce6eec03e74991abb5384170e7c65fcd7522e409b8e83d7e6372add0f12a
Python-2.7.10 installieren ...
Patch-Datei ./Lib/site.py
Installierte Python-2.7.10 unter /Users/tylerarbour/.pyenv/versions/2.7.10

War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

decentral1se picture decentral1se  ·  3Kommentare

demba picture demba  ·  3Kommentare

maksimr picture maksimr  ·  3Kommentare

bryant1410 picture bryant1410  ·  3Kommentare

bersbersbers picture bersbersbers  ·  3Kommentare