Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install python 3.7.0 using pyenv?

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
like image 637
krtk30 Avatar asked Aug 14 '18 10:08

krtk30


People also ask

Does Pyenv install pip?

Project description pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. NOTE: This is a placeholder package. pyenv is a collection of shell scripts and not installable with pip.

Where is Python installed Pyenv?

PROTIP: When pyenv is installed, a folder ~/. pyenv is created under your user $HOME folder. Within the shims folder are every Python command in every installed version of Python—python, pip, etc.

How do I install a different version of Python?

Install that version using "make install". Install all other versions using "make altinstall". For example, if you want to install Python 2.5, 2.6 and 3.0 with 2.6 being the primary version, you would execute "make install" in your 2.6 build directory and "make altinstall" in the others.

What version of python do I have installed with pyenv?

In order to use the version of Python through pyenv, it's essential to understand the shell's PATH variable. PATH determines where the shell searches for files by the name of the command. You must ensure the shell will find the version of Python run by pyenv, not the one installed by default (which is often called the system version).

Is there a version of Python 3 10 for Windows?

Python 3.6.9 and 3.6.10 was released as source only - there is no compiled version for Windows. You may wish to compile it yourself, but before you do, please read the good advice in this related thread. After pyenv install, we need to call pyenv rehash before setting it global/local as discussed here

Is it worth having pyenv installed on your system?

Even if you already have Python installed on your system, it is worth having pyenv installed so that you can easily try out new language features or help contribute to a project that is on a different version of Python. Why Not Use System Python? “System Python” is the Python that comes installed on your operating system.

What do I need to install pyenv?

Before you install pyenv itself, you’re going to need some OS-specific dependencies. These dependencies are mostly development utilities written in C and are required because pyenv installs Python by building from source. For a more detailed breakdown and explanation of the build dependencies, you can check out the official docs.


Video Answer


2 Answers

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
like image 167
Mayank Bansal Avatar answered Nov 24 '22 05:11

Mayank Bansal


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

like image 41
Ben Gartner Avatar answered Nov 24 '22 03:11

Ben Gartner