LoginSignup
29
19

More than 5 years have passed since last update.

pyenvでpythonインストール時にエラーが出たときの対処法

Posted at

環境

  • macOS Sierra 10.12.2

症状

pyenvでpythonをインストールしようとしたところ、以下のようなエラーが出て失敗した。

$ pyenv install 2.7.xx

Installing Python-2.7.xx...

ERROR: The Python zlib extension was not compiled. Missing the zlib?

Please consult to the Wiki page to fix the problem.
https://github.com/yyuu/pyenv/wiki/Common-build-problems

BUILD FAILED

対処法

メッセージに書かれているページによると、以下のように入力すれば良いらしい。

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.xx

これで治らなかった場合は、XCode command line toolsの再インストールをしろと書かれている。

$ xcode-select --install
29
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
19