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

ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? #950

Closed
jingle0927 opened this Issue Jul 17, 2017 · 38 comments

Comments

Projects
None yet
@jingle0927

jingle0927 commented Jul 17, 2017

➜ ~ pyenv install 3.5.2
Installing Python-3.5.2...
patching file Lib/venv/scripts/posix/activate.fish
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/pyenv/pyenv/wiki/Common-build-problems

BUILD FAILED (Deepin 15.4 using python-build 20160602)

Inspect or clean up the working tree at /tmp/python-build.20170717074120.10900
Results logged to /tmp/python-build.20170717074120.10900.log

Last 10 log lines:
(cd /home/zonzely/.pyenv/versions/3.5.2/share/man/man1; ln -s python3.5.1 python3.1)
if test "xupgrade" != "xno" ; then
case upgrade in
upgrade) ensurepip="--upgrade" ;;
install|*) ensurepip="" ;;
esac;
./python -E -m ensurepip
$ensurepip --root=/ ;
fi
Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS

@aitk

This comment has been minimized.

aitk commented Jul 19, 2017

What os and version are you using ?

Also the fix is right there in the message you will need to go to https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib then just copy and paste the script for your specific os

@elderone

This comment has been minimized.

elderone commented Aug 7, 2017

Debian GNU/Linux 9.1 (stretch)
pyenv 1.1.3
CFLAGS=-I/usr/include/openssl LDFLAGS=-L/usr/lib pyenv install -v 3.2.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/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Debian 9.1 using python-build 20160602)

Inspect or clean up the working tree at /tmp/python-build.20170807132419.25380
Results logged to /tmp/python-build.20170807132419.25380.log

Last 10 log lines:
rm -f /home/elderone/.pyenv/versions/3.2.3/bin/python3-config
(cd /home/elderone/.pyenv/versions/3.2.3/bin; ln -s python3.2-config python3-config)
rm -f /home/elderone/.pyenv/versions/3.2.3/lib/pkgconfig/python3.pc
(cd /home/elderone/.pyenv/versions/3.2.3/lib/pkgconfig; ln -s python-3.2.pc python3.pc)
rm -f /home/elderone/.pyenv/versions/3.2.3/bin/idle3
(cd /home/elderone/.pyenv/versions/3.2.3/bin; ln -s idle3.2 idle3)
rm -f /home/elderone/.pyenv/versions/3.2.3/bin/pydoc3
(cd /home/elderone/.pyenv/versions/3.2.3/bin; ln -s pydoc3.2 pydoc3)
rm -f /home/elderone/.pyenv/versions/3.2.3/bin/2to3
(cd /home/elderone/.pyenv/versions/3.2.3/bin; ln -s 2to3-3.2 2to3)
@elderone

This comment has been minimized.

elderone commented Aug 7, 2017

building '_ssl' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/openssl -I/home/elderone/.pyenv/versions/3.2.3/include -fPIC -IInclude -I. -I./Include -I/home/elderone/.pyenv/versions/3.2.3/include
 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/tmp/python-build.20170807132419.25380/Python-3.2.3 -c /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c -o build/temp.linux-x86_64-3.2/tm
p/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.o
In file included from Include/Python.h:111:0,
                 from /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:17:
Include/modsupport.h:27:1: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c: In function ‘_create_tuple_for_X509_NAME’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:487:35: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY {aka struct X509_name_entry_st}’
             if (rdn_level != entry->set) {
                                   ^~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c: In function ‘_get_peer_alt_names’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:607:16: error: dereferencing pointer to incomplete type ‘X509_EXTENSION {aka struct X509_extension_st}’
         p = ext->value->data;
                ^~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c: In function ‘PySSL_cipher’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:960:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     cipher_protocol = SSL_CIPHER_get_version(current);
                     ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c: In function ‘context_new’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1458:9: warning: ‘TLSv1_method’ is deprecated [-Wdeprecated-declarations]
         ctx = SSL_CTX_new(TLSv1_method());
         ^~~
In file included from /usr/include/openssl/ct.h:13:0,
                 from /usr/include/openssl/ssl.h:61,
                 from /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:93:
/usr/include/openssl/ssl.h:1612:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */
 ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1465:27: warning: implicit declaration of function ‘SSLv2_method’ [-Wimplicit-function-declaration]
         ctx = SSL_CTX_new(SSLv2_method());
                           ^~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1465:27: warning: passing argument 1 of ‘SSL_CTX_new’ makes pointer from integer without a cast [-Wint-conversion]
In file included from /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:93:0:
/usr/include/openssl/ssl.h:1321:17: note: expected ‘const SSL_METHOD * {aka const struct ssl_method_st *}’ but argument is of type ‘int’
 __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                 ^~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c: In function ‘PySSL_RAND_egd’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1924:13: warning: implicit declaration of function ‘RAND_egd’ [-Wimplicit-function-declaration]
     bytes = RAND_egd(PyBytes_AsString(path));
             ^~~~~~~~
At top level:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1974:13: warning: ‘_ssl_thread_locking_function’ defined but not used [-Wunused-function]
 static void _ssl_thread_locking_function
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_ssl.c:1970:22: warning: ‘_ssl_thread_id_function’ defined but not used [-Wunused-function]
 static unsigned long _ssl_thread_id_function (void) {
                      ^~~~~~~~~~~~~~~~~~~~~~~
building '_hashlib' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/openssl -I/home/elderone/.pyenv/versions/3.2.3/include -fPIC -IInclude -I. -I./Include -I/home/elderone/.pyenv/versions/3.2.3/include
 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/tmp/python-build.20170807132419.25380/Python-3.2.3 -c /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c -o build/temp.linux-x86_6
4-3.2/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.o
In file included from Include/Python.h:111:0,
                 from /tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:16:
Include/modsupport.h:27:1: warning: ‘_PyArg_ParseTuple_SizeT’ is an unrecognized format function type [-Wformat=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
 ^~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:62:26: error: field ‘ctx’ has incomplete type
     EVP_MD_CTX           ctx;   /* OpenSSL message digest context */
                          ^~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c: In function ‘EVP_dealloc’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:129:5: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’ [-Wimplicit-function-declaration]
     EVP_MD_CTX_cleanup(&self->ctx);
     ^~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c: In function ‘EVP_digest’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:165:16: error: storage size of ‘temp_ctx’ isn’t known
     EVP_MD_CTX temp_ctx;
                ^~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:165:16: warning: unused variable ‘temp_ctx’ [-Wunused-variable]
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c: In function ‘EVP_hexdigest’:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:185:16: error: storage size of ‘temp_ctx’ isn’t known
     EVP_MD_CTX temp_ctx;
                ^~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:185:16: warning: unused variable ‘temp_ctx’ [-Wunused-variable]
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c: At top level:
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_md5_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:77:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(md5)
 ^~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_sha1_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:78:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(sha1)
 ^~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_sha224_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:80:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(sha224)
 ^~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_sha256_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:81:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(sha256)
 ^~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_sha384_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:82:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(sha384)
 ^~~~~~~~~~~~~~~~~~~~~
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:74:23: error: storage size of ‘CONST_new_sha512_ctx’ isn’t known
     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
                       ^
/tmp/python-build.20170807132419.25380/Python-3.2.3/Modules/_hashopenssl.c:83:1: note: in expansion of macro ‘DEFINE_CONSTS_FOR_NEW’
 DEFINE_CONSTS_FOR_NEW(sha512)
 ^~~~~~~~~~~~~~~~~~~~~

Python build finished, but the necessary bits to build these modules were not found:
_dbm               _gdbm                              
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
_hashlib           _ssl                               

@elderone

This comment has been minimized.

elderone commented Aug 8, 2017

CFLAGS="-I/usr/include/x86_64-linux-gnu/" LDFLAGS="-L/usr/lib/x86_64-linux-gnu/" PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.2.3
all the same...

@bosr

This comment has been minimized.

bosr commented Aug 28, 2017

Hi, look at #945, it's because Debian 9 uses OpenSSL 1.1.0 which support in CPython was added in 3.5.3 (more details in the issue above). Cheers

@dstyp

This comment has been minimized.

dstyp commented Sep 8, 2017

No solution to this yet? Trying to install...

@bosr

This comment has been minimized.

bosr commented Sep 8, 2017

@dstyp, are you trying to install a version < 3.5.3? If so I don't know, else the above answers (CFLAGS=-I/usr/include/openssl LDFLAGS=-L/usr/lib pyenv install -v 3.5.3) should work.

@dstyp

This comment has been minimized.

dstyp commented Sep 8, 2017

Worked! Thanks, completely overlooked your comment.

@tirtaabimanyu

This comment has been minimized.

tirtaabimanyu commented Sep 21, 2017

+1 having same trouble installing 3.5.2 on ubuntu

@makslevental

This comment has been minimized.

makslevental commented Sep 29, 2017

i'm having this on mac os high sierra even with setting CFLAGS and LDFLAGS correctly using brew --prefix

@uber1geek

This comment has been minimized.

uber1geek commented Sep 29, 2017

@makslevental Same here.

Is there a fix available for HighSierra ?

@makslevental

This comment has been minimized.

makslevental commented Sep 29, 2017

@uber1geek the problem turned out to be the openssl hadn't actually successfully installed (even though homebrew reported that it had). run brew uninstall openssl && brew install openssl && CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 3.6.2

@colllin

This comment has been minimized.

colllin commented Sep 29, 2017

I'm using macOS / OSX, but not homebrew, and I'm having this issue as well.

Is there a way to determine...

  1. whether I have openssl installed?

    I tried...

    $ which openssl
    /usr/bin/openssl
    
  2. the correct CFLAGS / LDFLAGS?

    I tried...

    $ CFLAGS="-I/usr/bin/openssl" LDFLAGS="-L/usr/lib" pyenv install 3.6.2
    Downloading readline-6.3.tar.gz...
    -> https://pyenv.github.io/pythons/56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43
    Installing readline-6.3...
    Installed readline-6.3 to /Users/colllin/.pyenv/versions/3.6.2
    
    Downloading Python-3.6.2.tar.xz...
    -> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
    Installing Python-3.6.2...
    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/pyenv/pyenv/wiki/Common-build-problems
    
    
    BUILD FAILED (OS X 10.13 using python-build 20160602)
    
    Inspect or clean up the working tree at /var/folders/95/rsx7725n60vf4gjk0g9_1h_w0000gn/T/python-build.20170929153257.78102
    Results logged to /var/folders/95/rsx7725n60vf4gjk0g9_1h_w0000gn/T/python-build.20170929153257.78102.log
    
    Last 10 log lines:
    			upgrade) ensurepip="--upgrade" ;; \
    			install|*) ensurepip="" ;; \
    		esac; \
    		 ./python.exe -E -m ensurepip \
    			$ensurepip --root=/ ; \
    	fi
    Collecting setuptools
    Collecting pip
    Installing collected packages: setuptools, pip
    Successfully installed pip-9.0.1 setuptools-28.8.0
    
@makslevental

This comment has been minimized.

makslevental commented Sep 29, 2017

@colllin you need the openssl headers which are in the include dir. i don't know where yours would be

@laenderoliveira

This comment has been minimized.

laenderoliveira commented Oct 4, 2017

I found a solution to my problem. (Fedora 26)
Uninstall:
$ dnf remove openssl-devel

Install:
$ dnf install compat-openssl10-devel

@jlott

This comment has been minimized.

jlott commented Oct 5, 2017

Mac OS X 10.13 (High Sierra) uses LibreSSL 2.2.7 but doesnt include the C headers necessary to compile the SSL extension for python. I know of no Apple-provided method to get them installed (via XCode or whatever else). To get this working without homebrew or any other shenanigans (assuming you have pyenv installed and working properly);

  • curl -O https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.2.7.tar.gz
  • tar xvf libressl-2.2.7.tar.gz
  • CFLAGS="-I./libressl-2.2.7/include" pyenv install 3.6.3 (or whatever other version)

(post edit)
I believe that pyenv is supposed to install openssl as necessary on Mac OS X in order to make the whole pyenv install process work properly. That is probably the real issue here, but the above steps appear to work around the problem for now.

@matheusabr

This comment has been minimized.

matheusabr commented Oct 11, 2017

I tried all suggestions above but it is not working on Hight Sierra 10.13.1 Beta (17B25c) and Xcode 9

@crazyxrp

This comment has been minimized.

crazyxrp commented Oct 12, 2017

@matheusabr I use @makslevental's method and it works
os version 10.13
installed python version 3.5.4

@matheusabr

This comment has been minimized.

matheusabr commented Oct 13, 2017

@crazyxrp It really works! Thanks

@tranvansang

This comment has been minimized.

tranvansang commented Oct 16, 2017

install openssl-devel.x86_64 or (openssl-dev...) should work.

openssl package only is not enough

Source: https://stackoverflow.com/questions/6171210/building-python-and-more-on-missing-modules

@mapleoin

This comment has been minimized.

mapleoin commented Oct 20, 2017

On Debian stretch, installing libssl1.0-dev (and removing libssl-dev) with apt worked fine. Python 2.7 installs fine now.

@jonatanvianna

This comment has been minimized.

jonatanvianna commented Dec 1, 2017

@laenderoliveira
woked for me

I found a solution to my problem. (Fedora 26)
Uninstall:
$ dnf remove openssl-devel
Install:
$ dnf install compat-openssl10-devel

@Beenhakker

This comment has been minimized.

Beenhakker commented Dec 4, 2017

In my case (Homebrew, OSX 10.13.1 - High Sierra) I had to specify both CFLAGS and CPPFLAGS:
LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" CFLAGS="-I/usr/local/opt/openssl/include" pyenv install 3.6.3

@robrem

This comment has been minimized.

robrem commented Dec 14, 2017

@Beenhakker
Your method worked for me in OSX 10.13.1 for installing 3.6.3. Thanks!

@justinjdickow

This comment has been minimized.

justinjdickow commented Dec 31, 2017

Not working for me to install 2.7.14 :(

@awper361

This comment has been minimized.

awper361 commented Jan 5, 2018

Not working for me to install 2.7.6

@Nav31

This comment has been minimized.

Nav31 commented Jan 16, 2018

@Beenhakker Thanks!
Your solution worked for me as well.

@clemenshug

This comment has been minimized.

clemenshug commented Feb 8, 2018

Had the same issue on Scientific Linux release 6.9 (Carbon). Following the instructions in the wiki didn't quite solve the problem. Solved it like @Beenhakker, except that I also added sqlite:

CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sqlite)/include" \
CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sqlite)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sqlite)/lib" \
pyenv install -v 3.6.4

@jingle0927 jingle0927 closed this Feb 9, 2018

robnagler added a commit to radiasoft/container-beamsim-jupyter that referenced this issue Feb 12, 2018

openssl 1.1 does not work with python
need older version (compat-openssl10-devel)
pyenv/pyenv#950 (comment)
@dshepelev15

This comment has been minimized.

dshepelev15 commented May 31, 2018

I have mac os Sierra 10.13.4, openssl version LibreSSL 2.2.7, python 3.6.5 and 2.7.10, but I can not install everything via pip(3) install ... because "There was a problem confirming the ssl certificate: [SSL: UNKNOWN_PROTOCOL] unknown protocol". Do you have any solutions for this?

@justinjdickow

This comment has been minimized.

justinjdickow commented Jun 14, 2018

At this point I've decided pyenv isn't worth the hassle. Activating a virtual environment using %source bin/activate is not a struggle, but getting pyenv to work properly is.

@colllin

This comment has been minimized.

colllin commented Jun 15, 2018

@justinjdickow I highly recommend checking out pipenv If you haven’t already. Besides managing your python environments, it also produces and maintains a lock file.

@sabujp

This comment has been minimized.

sabujp commented Jul 1, 2018

anyone came here trying to get 3.7.0 working ubuntu trusty (14.04), it won't work (easily with ubuntu provided packages) since 3.7.0 requires openssl 1.0.2 and trusty only has 1.0.1 : travis-ci/travis-ci#9069

@aRobinson-R7

This comment has been minimized.

aRobinson-R7 commented Jul 19, 2018

Thanks @sabujp - this was exactly my issue

@saurajeet

This comment has been minimized.

saurajeet commented Jul 23, 2018

I had trouble installing 2.7 in ubuntu 18.04. Here is what worked

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"

$  pyenv install 2.7.8
Downloading Python-2.7.8.tar.xz...
-> https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
Installing Python-2.7.8...
patching file ./Lib/site.py
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
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/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Ubuntu 18.04 using python-build 1.2.3-43-g35f7ef8)
Inspect or clean up the working tree at /tmp/python-build.20180723091911.21509
Results logged to /tmp/python-build.20180723091911.21509.log

$ sudo apt install -y libssl1.0-dev
The following packages will be REMOVED:
  libssl-dev
The following NEW packages will be installed:
  libssl1.0-dev
0 upgraded, 1 newly installed, 1 to remove and 2 not upgraded.
Need to get 1,364 kB of archives.
After this operation, 380 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.0-dev amd64 1.0.2n-1ubuntu5.1 [1,364 kB]
Fetched 1,364 kB in 1s (2,098 kB/s)     
(Reading database ... 188780 files and directories currently installed.)
Removing libssl-dev:amd64 (1.1.0g-2ubuntu4.1) ...
Selecting previously unselected package libssl1.0-dev:amd64.
(Reading database ... 188695 files and directories currently installed.)
Preparing to unpack .../libssl1.0-dev_1.0.2n-1ubuntu5.1_amd64.deb ...
Unpacking libssl1.0-dev:amd64 (1.0.2n-1ubuntu5.1) ...
Setting up libssl1.0-dev:amd64 (1.0.2n-1ubuntu5.1) ...

$ pyenv install 2.7.8
Downloading Python-2.7.8.tar.xz...
-> https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
Installing Python-2.7.8...
patching file ./Lib/site.py
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
Installing pip from https://bootstrap.pypa.io/get-pip.py...
Installed Python-2.7.8 to /home/saurajeet/.pyenv/versions/2.7.8
@spanierm

This comment has been minimized.

spanierm commented Jul 24, 2018

The same for me on Ubuntu 18.04. Installing Python 2.7.5 only worked after I removed libssl-dev and installed libssl1.0-dev afterwards. Then a simple pyenv install 2.7.5 worked as expected.

@JoBergs

This comment has been minimized.

JoBergs commented Jul 27, 2018

I can confirm this for Raspbian Stretch and Python 3.6.3. Didn't work without installing libssl1.0-dev but it's fine now.

@virgiawan

This comment has been minimized.

virgiawan commented Oct 19, 2018

Thank @Beenhakker ...
You save my day

MacOS 10.13.6
Install python 2.7.10

@AndyLockhart

This comment has been minimized.

AndyLockhart commented Dec 13, 2018

worked for me, thank you very much @Beenhakker

Mac OS 10.13.1
python version 3.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment