How to install python 3.7.0 using pyenv?
Asked Answered
P

2

13

I tried to install with the command "pyenv install 3.7.0" and getting the error as follows

Downloading Python-3.7.0.tar.xz...
-> https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
Installing Python-3.7.0...
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 14.04 using python-build 20180424)

I have checked with the solutions from https://github.com/pyenv/pyenv/wiki/Common-build-problems and tried

CFLAGS=-I/usr/include/openssl \
LDFLAGS=-L/usr/lib64 \
pyenv install -v 3.7.0

Again I am facing the same error as

The Python ssl extension was not compiled. Missing the OpenSSL lib?

Also tried to install python versions less than 3.7 which all are installed without error. Is there any dependent package or version update that I am missing here. I have openssl version

OpenSSL 1.0.1f 6 Jan 2014
Payable answered 14/8, 2018 at 10:10 Comment(0)
J
3

Is there any dependent package or version update that I am missing here.

Yes, unfortunately there is. Python 3.7.0 requires OpenSSL 1.0.2. I couldn't find a better source than the dev mailing list. So far I've been unsuccessful getting Python 3.7.0 working on Ubuntu 14.04, as getting the right version of OpenSSL installed and not conflicting has been a trick.

Python 3.7: Require OpenSSL >=1.0.2

https://mail.python.org/pipermail/python-dev/2018-January/151718.html

Janenejanenna answered 8/10, 2018 at 19:46 Comment(0)
T
12

You can install the same by first installing [email protected] by the command

    brew install '[email protected]'

And the you can install python3.7 using:

    CONFIGURE_OPTS="--with-openssl=$(brew --prefix [email protected])" pyenv install 3.7.0

Or if you don't want to install any specific version for openssl, then you can use the below command for openssl package.

    CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.7.0
Teratism answered 14/8, 2018 at 10:31 Comment(1)
Can't you just brew install python or brew upgrade python? I did and it appears to install dependencies gdbm, openssl, sqlite. It is currently python 3.7.2 though so maybe this was an issue previouslySadonia
J
3

Is there any dependent package or version update that I am missing here.

Yes, unfortunately there is. Python 3.7.0 requires OpenSSL 1.0.2. I couldn't find a better source than the dev mailing list. So far I've been unsuccessful getting Python 3.7.0 working on Ubuntu 14.04, as getting the right version of OpenSSL installed and not conflicting has been a trick.

Python 3.7: Require OpenSSL >=1.0.2

https://mail.python.org/pipermail/python-dev/2018-January/151718.html

Janenejanenna answered 8/10, 2018 at 19:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.