Skip to content

Instantly share code, notes, and snippets.

@diegoponciano
Last active June 15, 2023 09:04
Show Gist options
  • Save diegoponciano/61a1a3b624dcb6f39d7edc93dc4d2076 to your computer and use it in GitHub Desktop.
Save diegoponciano/61a1a3b624dcb6f39d7edc93dc4d2076 to your computer and use it in GitHub Desktop.
Solution to "The Python ssl extension was not compiled. Missing the OpenSSL lib?"
#!/bin/sh
# Taken from https://github.com/pyenv/pyenv/issues/1184#issuecomment-469450250
wget https://www.openssl.org/source/openssl-1.1.0j.tar.gz
tar -xvzf openssl-1.1.0j.tar.gz
cd openssl-1.1.0j/
./config --prefix=/usr/local/openssl11 --openssldir=/usr/local/openssl11
make
make install
CONFIGURE_OPTS="--with-openssl=/usr/local/openssl11" LDFLAGS="-L/usr/local/openssl11/lib" LD_RUN_PATH="/usr/local/openssl11/lib" CPPFLAGS="-I/usr/local/openssl11/include" CFLAGS="-I/usr/local/openssl11/include" pyenv install -v 3.7.3
# load and rehash pyenv and you're good to go
eval "$(pyenv init -)"
pyenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment