12
12

More than 5 years have passed since last update.

Mac OSX Mavericks で pyenv

Last updated at Posted at 2014-09-08

概要

他の人の紹介記事以上のことは書いてないです。

homebrew で pyenv インストール、
anyenv とかは使ってない、というかんじの内容。

awscli を入れたかったので。

PATH

Understanding Shims | yyuu/pyenv
Understanding Shims

pyenv works by inserting a directory of shims at the front of your PATH:

~/.pyenv/shims:/usr/local/bin:/usr/bin:/bin

とのことなんで、
~/.pyenv/shims にパスを通す設定を、シェル起動時に読み込まれるファイルに書いておく。

以下の設定は ~/.pyenv が存在する場合だけパスを追加して、pyenv を初期化する。

# pyenv -----------------------------------------
if [ -d $HOME/.pyenv ]; then
  export PATH="${HOME}/.pyenv/shims:$PATH"
  eval "$(pyenv init -)"
fi

Install

// brew を利用して pyenv をインストール
$ brew install pyenv

// pyenv rehash を自動化する plugin をインストール
$ git clone https://github.com/yyuu/pyenv-pip-rehash.git ~/.pyenv/plugins/pyenv-pip-rehash

// インストール可能なバージョン確認
$ pyenv install -l

// python のバージョンを指定してインストール
$ pyenv install 2.7.8

// python パス確認
$ which python
/Users/qurage/.pyenv/shims/python

// python バージョン確認
$ python --version                                
Python 2.7.8

// easy_install パス確認
$ which easy_install
/Users/qurage/.pyenv/shims/easy_install

// easy_install バージョン確認
$ easy_install --version
setuptools 5.7

// pip バージョンとパス確認
$ pip —version
pip 1.5.6 from /Users/qurage/.pyenv/versions/2.7.8/lib/python2.7/site-packages (python 2.7)

Python の安定版のバージョンを Python.org で確認

参考

12
12
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
12
12