[Tips] Dealing with errors that occur when trying to install Python 3 series less than 3.5.3 with pyenv

Problem: Error in Python installation

input

pyenv install 3.4.8

output

Downloading Python-3.4.8.tar.xz...
-> https://www.python.org/ftp/python/3.4.8/Python-3.4.8.tar.xz
Installing Python-3.4.8...
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.19-1-gece59ca8)

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

Last 10 log lines:
(cd /home/【User name】/.anyenv/envs/pyenv/versions/3.4.8/share/man/man1; ln -s python3.4.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 9.0.1 requires SSL/TLS

environment

--Ubuntu 18.04 LTS (Windows 10 2004 WSL1 environment)

Cause: Supported version of OpenSSL

Up to 3.5.2 of Python3 series does not support OpenSSL 1.1.

Solution: Downgrade OpenSSL

sudo apt install libssl1.0-dev
pyenv install 3.4.8

Supplement

1. Post-processing

Installing OpenSSL 1.0 will downgrade OpenSSL. After successfully installing Python, execute the following.

sudo apt install libssl-dev

2. For Ruby

Even in Ruby, an error occurs due to the same cause when it is less than 2.4. For details, refer to the article here.

References

-Cannot install with pyenv

Recommended Posts

[Tips] Dealing with errors that occur when trying to install Python 3 series less than 3.5.3 with pyenv
Unable to install Python with pyenv
I wanted to install Python 3.4.3 with Homebrew + pyenv
Error when trying to install psycopg2 in Python
Install python with pyenv
Eliminate errors that occur when using Django REST Swagger with Django 3.0
[python] A note when trying to use numpy with Cython
A program that failed when trying to create a linebot with reference to "Dialogue system made with python"
List of libraries to install when installing Python using Pyenv
How to not escape Japanese when dealing with json in python
I get an error when trying to install maec 4.0.1.0 with pip
Tips to know when programming competitively with Python2 (Other language specifications)
Install packages that need to be compiled with Python3 with pip [Windows]
How to deal with errors when installing Python and pip with choco
How to install Anaconda with pyenv
ImportError when trying to use gcloud package with AWS Lambda Python version
A memo that allows you to change Pineapple's Python environment with pyenv
Tips (input / output) that you should know when programming competitive programming with Python2
[Python / Pandas] A bug occurs when trying to replace a DataFrame with `None` with` replace`
I get a UnicodeDecodeError when trying to connect to oracle with python sqlalchemy
Tips (control structure) that you should know when programming competitive programming with Python2
Tips (data structure) that you should know when programming competitive programming with Python2
Install Python as a Framework with pyenv
Tips for dealing with binaries in Python
Trying to handle SQLite3 with Python [Note]
Install Python less than 3.5.3 on macOS Catalina
10 Python errors that are common to beginners
[Python] How to deal with module errors
How to install python3 with docker centos
Workaround if you get an error when trying to install PySide with pip
Problems and solutions when trying to put rbenv with git submodule (also pyenv)
What to do if you get an error when installing python with pyenv
A story that I was addicted to when I made SFTP communication with python
How to deal with errors when hitting pip ②
Personal tips when doing various things with Python 3
Precautions when dealing with control structures in Python 2.6
Character encoding when dealing with files in Python 3
How to use tkinter with python in pyenv
[Python] Dealing with multiple call errors in ray.init
Materials to read when getting started with Python
A story that required preparation when trying to do a Django tutorial with plain centos7
A story that failed when trying to remove the suffix from the string with rstrip
What to do if you get an OpenSSL error when installing Python 2 with pyenv
A story that got stuck when trying to upgrade the Python version on GCE
I got stuck when trying to specify a relative path with relative_to () in python
[Introduction to Python] What is the important "if __name__ =='__main__':" when dealing with modules?
A memo of misunderstanding when trying to load the entire self-made module with Python3
I get an error when I try to raise Python to 3 series using pyenv on Catalina