k0b0's record.

Computer Engineering, Arts and Books

MacOS(high sierra)にpythonをインストール

pyenvからpythonをインストールしようとして少し躓いたのでメモ。

pyenvからpythonをインストールしようとすると次のようなメッセージが表示され、うまくインストールできない。

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

解決方法

以下のコマンドを実行する。

(コマンドの最後はインストールしたいpythonの任意のバージョン)

CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install -v (pythonのバージョン)

 

{参考サイト}

Mac環境へのPython3系インストール - Qiita

HighSierraにしてpyenvからpython入れようとしたら失敗した”The Python ssl extension was not compiled. Missing the OpenSSL lib?” - Qiita