-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.7.0 :: The Python ssl extension was not compiled. Missing the OpenSSL lib? #1184
Comments
Same with Ubuntu 14 CFLAGS=-I/usr/include/openssl Please consult to the Wiki page to fix the problem. BUILD FAILED (Ubuntu 14.04 using python-build 1.2.5-4-gc057a80) Inspect or clean up the working tree at /tmp/python-build.20180706171040.46966 Last 10 log lines: |
I have the same issue. I also tried the following:
Since it seems to do the trick on Ubuntu. This however does not work on macOS. |
Seeing the same thing on Amazon Linux (ie, Fedora essentially) |
still doesn't work yet. |
I can successfully install CPython 2.7.15, 3.6.6, and 3.7.0 using |
I ran into this issue with openssl
|
@lukebakken I also got it to work with OpenSSL 1.0.2o_2 by passing the same
I wish I knew why this wasn't needed under |
@lgw4 I'll give that a try just for grins. It's interesting that 1.0.2 worked. Prior to installing OpenSSL 1.1 the test for OpenSSL failed with a missing symbol in the dynamic library ( |
@lukebakken FWIW, I've also got the following environment variables set:
|
I uninstalled
None of the environment variables mentioned here are exported, and I ran the installation as follows:
Installation succeeds, and you can see the correct compiler and linker arguments in
So it looks like, for Python |
#1191 is only partially correct (for now). The system I wrote that patch for was running OSX 10.11 so I didn't see the next edge case coming... On OSX 10.13 it proceeds to compile OpenSSL 1.0* as you'd except, however it fails to produce a library containing the After a little tinkering I managed to build OpenSSL, albeit the stable release, and it appears to work fine when compiled against Python 3.7.0. (PS - 3.6.6 fails on 10.13 in the same way. If I switch its build script to use the stable release of OpenSSL it does seem to fix the problem there too. Hmm.) index 1ff0ac29..2d5552d1 100755
--- a/plugins/python-build/bin/python-build
+++ b/plugins/python-build/bin/python-build
@@ -1504,6 +1504,9 @@ use_homebrew_openssl() {
}
build_package_mac_openssl() {
+ OPENSSL_VERSION_LTS='1.0.*'
+ OPENSSL_VERSION_STABLE='1.1.*'
+
# Install to a subdirectory since we don't want shims for bin/openssl.
OPENSSL_PREFIX_PATH="${PREFIX_PATH}/openssl"
@@ -1520,12 +1523,25 @@ build_package_mac_openssl() {
# Hint OpenSSL that we prefer a 64-bit build.
export KERNEL_BITS="64"
OPENSSL_CONFIGURE="${OPENSSL_CONFIGURE:-./config}"
+ OPENSSL_OPTIONS="zlib-dynamic shared"
local nokerberos
- [[ "$1" != openssl-1.0.* ]] || nokerberos=1
+ [[ "$1" != openssl-${OPENSSL_VERSION_LTS} ]] || nokerberos=1
+
+ local openssl_stable
+ [[ "$1" == openssl-${OPENSSL_VERSION_STABLE} ]] && openssl_stable=1
+
+ # Set additional flags based on LTS versus Stable
+ if [[ ! $openssl_stable ]]; then
+ OPENSSL_OPTIONS="${OPENSSL_OPTIONS} no-ssl2 no-ssl3"
+ [[ $nokerberos ]] && OPENSSL_OPTIONS="${OPENSSL_OPTIONS} no-krb5"
+ else
+ # Deprecated: SSL2, KRB5
+ OPENSSL_OPTIONS="${OPENSSL_OPTIONS} no-ssl3"
+ fi
# Compile a shared lib with zlib dynamically linked, no kerberos.
- package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl2 no-ssl3 no-krb5 shared
+ package_option openssl configure --openssldir="$OPENSSLDIR" ${OPENSSL_OPTIONS}
# Default MAKE_OPTS are -j 2 which can confuse the build. Thankfully, make
# gives precedence to the last -j option, so we can override that.
diff --git a/plugins/python-build/share/python-build/3.7.0 b/plugins/python-build/share/python-build/3.7.0
index f65d2a73..11a8ce7f 100644
--- a/plugins/python-build/share/python-build/3.7.0
+++ b/plugins/python-build/share/python-build/3.7.0
@@ -1,5 +1,5 @@
#require_gcc
-install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
+install_package "openssl-1.1.0h" "https://www.openssl.org/source/openssl-1.1.0h.tar.gz#5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517" mac_openssl --if has_broken_mac_openssl
install_package "readline-6.3" "https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.7.0" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz#0382996d1ee6aafe59763426cf0139ffebe36984474d0ec4126dd1c40a8b3549" ldflags_dirs standard verify_py37 ensurepip``` |
@jhunkeler Awesome! However, had you switched to |
D'oh! Thank you! Yes, the latest LTS works fine 👍 diff --git a/plugins/python-build/share/python-build/3.7.0 b/plugins/python-build/share/python-build/3.7.0
index f65d2a73..173f3249 100644
--- a/plugins/python-build/share/python-build/3.7.0
+++ b/plugins/python-build/share/python-build/3.7.0
@@ -1,5 +1,5 @@
#require_gcc
-install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
+install_package "openssl-1.0.2o" "https://www.openssl.org/source/openssl-1.0.2o.tar.gz#ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" mac_openssl --if has_broken_mac_openssl
install_package "readline-6.3" "https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.7.0" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz#0382996d1ee6aafe59763426cf0139ffebe36984474d0ec4126dd1c40a8b3549" ldflags_dirs standard verify_py37 ensurepip``` |
Yep, this working for me in zsh: CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.7.0 But not working in fish :( set CONFIGURE_OPTS "--with-openssl="(brew --prefix openssl); and pyenv install 3.7.0 |
@rmerkushin I think your
I don’t use |
@lgw4 nope, it's not working. I think it's python installation script not properly working with fish :( |
use |
@Packets-n-Python did you end up finding a solution to install 3.7 on Ubuntu 14.04? |
@zyong812 Do you export any variables before install Python 3.7? Which version of OpenSSL do you install? |
Holy crap! I found a solution for fish! git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git (pyenv root)/plugins/pyenv-virtualenv
brew install autoconf pkg-config openssl readline My config.fish: set -x PYENV_ROOT ~/.pyenv
set -x PATH ~/.pyenv/bin $PATH
if status --is-interactive
source (pyenv init - | psub)
source (pyenv virtualenv-init - | psub)
end P.S.: No need extra environment variables |
For fish (@rmerkushin):
|
MacOS system,please use $ brew install pyenv If you force do, can run this. $ brew install 'openssl@1.1'
$ CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" pyenv install 3.7.0 @rmerkushin l test can be install Python3.7.0 with pyenv normally,hope to help you! |
I've faced that issue in Debian 8.11 (jessie) with default "OpenSSL 1.0.1t 3 May 2016" version.
Latest OpenSSL 1.0.2 has been downloaded and extracted into "/home/test/openssl" directory. Now let's build it into the same directory. I took instructions from here.
If compiling and testing passed well, you are become able to just link your fresh OpenSSL install to pyenv.
LD_RUN_PATH is a necessary option! |
On macOS with Homebrew, make sure that pkg-config is installed. Installing pyenv from Homebrew actually takes care of that. However, with git clone installation method, necessary dependences need to be installed manually. I had the issue on one of my Macs, while on another it was building fine. I tried adding OpenSSL 1.0.2, 1.1, LibreSSL paths in CFLAGS and LDFLAGS - no change. Finally, comparing installed Homebrew packages and build logs helped to narrow this down to pkg-config. You actually don't need to add OpenSSL paths manually, pkg-config takes care of that once it's installed (unlike zlib and sqlite, by the way). |
For Mac users, pyenv was supposed to work automatically by downloading and building a copy of OpenSSL specifically for the use of the Python version you're installing. Unfortunately, the code to do that neglected to actually tell the Python build process to use that copy of OpenSSL, which is why a lot of people in this thread advise you to install OpenSSL separately (e.g. using brew). But that shouldn't be necessary — pyenv has already built and installed a version of OpenSSL. The pull request I just submitted fixes things so that pyenv will actually tell Python to use the version it's just downloaded and built. |
I ran into this issue after installing e.g.
|
This all seems fine and great for installing new pyenv versions on OSX. But what if I already have dozens of pyenv environments created with an existing python version? Brew upgraded openssl to version 1.1 but all of my existing envs are linked to pyenv pythons using openssl 1.0.2. Is there any path to upgrade those or am I stuck recreating all of the environments? Or is there any way to have openssl versions 1.0.2 and 1.1 coexist on the same system? |
@mattdodge |
@hermansje Awesome! I didn't even think to run the install command to reinstall on the existing versions. That worked great! Thanks |
Very awesome!!! I just did. It's work. Many thanks |
Hi, I'm having the same issue and apparently can't solve it with any of the above. I'm running on macOS Mojave (10.14.6) and trying to install python 3.5.2. After installing
I have tried to run all the commands in the https://github.com/pyenv/pyenv/wiki/Common-build-problems page and additionally:
But I'm aways getting the same error:
Am I missing anything basic here? Do you have any suggestion? |
@damnko same error, did you find any solution? |
@chairco , nope. I ended up using |
@damnko @chairco Ok guys, here is the answer: #1425 (comment) |
@dmitrii-sim thank you! My headache is finally gone. |
Confirm that this works
|
CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" pyenv install 3.7.0 |
Thanks a lot @dmitrii-sim that worked, I was able to install also python 3.5.2 ! |
solved my problem with openssl 1.1.1c & python 3.8.0.b4 on centos 7 , thanks so much~~~ |
@mhart, I experience the same on Fedora 32. Did you find how to overcome the issue? |
@native-api @alexpulver On the Mac build, it specifically downloads and builds OpenSSL. It's just that it then doesn't set the paths correctly to pick it up. That's why there's a PR (#1241) containing a fix for that issue. This wasn't the same as the similar Linux issue, and all the talk about Homebrew in this ticket is a distraction from what's actually wrong. |
@al45tair The OP's issue was caused by an incompatible OpenSSL in Homebrew. Another version being built and ignored is wrong, of course, but it's a different issue -- that's why I closed this ticket but not your PR. |
To install Python 3.6, I followed the instructions at #1768 (comment). However, I got the error from the issue title/description. I tried to add CONFIGURE_OPTS as described here: #1184 (comment). The relevant command is:
However, it results in the same error. I'm not sure how others are able to run 3.6 on M1. Update: I can install 3.6.13! 3.6.15 (although the patch applies) fails with the error in the issue title/description. |
None of the options work for me on my M1 mac. It shows openssl version to be Upon initiating |
Also the exact error is as follows:
|
@Tapudp did you follow https://github.com/pyenv/pyenv/wiki#troubleshooting--faq ? |
I ran into this on an arm machine with an M2 chip, OSX 13.5.
|
Platform: macOS High Sierra 10.13.5
Pyenv version: Install by git clone
Python: 3.7.0
OpenSSL version: 1.0.2o_2 (installed from brew)
tricks below doesn't works for me:
The text was updated successfully, but these errors were encountered: