When I tried to install Python 2 with pyenv, I encountered an error related to OpenSSL and could not install it. I will write down the measures I took at that time.
--You are using macOS --Installing OpenSSL with homebrew
When I installed Python2 series with pyenv, the following error occurred.
$ pyenv install 2.7.10
python-build: use openssl from homebrew
python-build: use readline from homebrew
...abridgement...
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.15.5 using python-build 1.2.18-19-gcf81e5a0)
From Missing the OpenSSL lib?
, You can see that there is a problem with OpenSSL.
The reason why this error occurred in my environment was that the version of OpenSSL installed by homebrew is not 1.0 series. OpenSSL 1.0 series is required to install Python 2 series.
Let's check the version of OpenSSL installed by brew.
$ brew info openssl
[email protected]: stable 1.1.1g (bottled) [keg-only]
Temporarily unintall OpenSSL 1.1.
$ brew uninstall --ignore-dependencies openssl
The reason for adding --ignore-dependencies
is to ignore the dependencies and force the uninstall.
(If it depends on other software, it cannot be uninstalled without this option)
Next, install Python 2 series with pyenv. You don't need to install OpenSSL 1.0 series by yourself because pyenv will install OpenSSL 1.0 series without permission.
$ pyenv install 2.7.10
Installing openssl-1.0.2k...
Installed openssl-1.0.2k to /Users/hogesuke/.anyenv/envs/pyenv/versions/2.7.10
After successfully installing Python 2, reinstall the uninstalled OpenSSL 1.1 with homebrew.
$ brew install openssl
https://fumimaker.hatenablog.com/entry/2020/02/18/203434
Recommended Posts