KAROUSHI -Japanese Engineer Blog-

コボルドからドラゴンへ -Kobold to Dragon-

システムエンジニアのブログです。サイト名は「雑魚キャラからボスキャラへレベルアップしたい!」という思いを込めて命名しました。自分はやっとリザードマンになったくらいです。

pyenvでpythonの2.7.11インストール失敗時に"no acceptable C compiler found in $PATH"

概要

pyenvでpythonの2.7.11をインストールしようとしたらエラーが発生。

環境情報

VirtualBox: 5.0.16r105871

Linux: CentOS 6.7

詳細

# pyenv install 2.7.11

Downloading Python-2.7.11.tgz...
-> https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
Installing Python-2.7.11...

BUILD FAILED (CentOS release 6.7 (Final) using python-build 20160509)

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

Last 10 log lines:
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux2
checking EXTRAPLATDIR...
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/python-build.20160516110407.13929/Python-2.7.11':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

原因

Cのコンパイラがないため。

対処方法

Cコンパイラyumでインストールする。

# yum -y install gcc