Skip to content

Instantly share code, notes, and snippets.

@kentarosasaki
Created October 23, 2017 07:55
Show Gist options
  • Save kentarosasaki/dbf919df1481ba67ac3d4cd0f9652b62 to your computer and use it in GitHub Desktop.
Save kentarosasaki/dbf919df1481ba67ac3d4cd0f9652b62 to your computer and use it in GitHub Desktop.
pyenv を使って CentOS 5 に Python 3 をインストールする方法 ref: http://qiita.com/kentarosasaki/items/d7c492a38329f1b0f948
$ sudo yum -y install gcc make readline readline-devel zlib zlib-devel bzip2 bzip2-devel sqlite sqlite-devel openssl openssl-devel git
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
$ exec "$SHELL"
$ pyenv install --list
Available versions:
2.1.3
...
3.5.4
...
$ CFLAGS=-I/usr/include/openssl LDFLAGS=-L/usr/lib64 pyenv install -v 3.5.4
$ pyenv versions
* system
3.5.4 (set by /home/user/.pyenv/version)
$ pyenv global 3.5.4
$ pyenv versions
system
* 3.5.4 (set by /home/user/.pyenv/version)
$ python -V
Python 3.5.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment