pyenvを入れてみた

仕事でpythonを使うことが増えてきたので、pyenvを入れてみた

pyenv

pyenvは、ローカルディレクトリ毎に のバージョンを指定できるツールです。

yyuu/pyenv · GitHub

インストール

Mac

MacではHomebrewを使っていれるとマニュアルに書いてあったので、ためしてみたい

$ brew update
$ brew install pyenv

が、、、、

$ brew install pyenv
Error: pyenv-20140602 already installed
To install this version, first `brew unlink pyenv'
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

そういえば、昔pyenv入れたの忘れてた。。。

ということで一度削除して再度入れ直すことにした

$ brew unlink pyenv
Unlinking /usr/local/Cellar/pyenv/20140602... 0 symlinks removed
$ brew install pyenv
==> Downloading https://github.com/yyuu/pyenv/archive/v20140705.tar.gz
######################################################################## 100.0%
==> Caveats
To enable shims and autocompletion add to your profile:
  if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi

To use Homebrew's directories rather than ~/.pyenv add to your profile:
  export PYENV_ROOT=/usr/local/opt/pyenv
==> Summary
🍺  /usr/local/Cellar/pyenv/20140705: 287 files, 2.6M, built in 30 seconds

うまくいった

$ sudo yum install bzip2-devel
$ pyenv local system
$ pyenv rehash
$ pyenv uninstall 2.7.6
$ pyenv install 2.7.6

2.7.6のセットアップが完了!