Python construction notes for yourself. I will write it on the assumption that homebrew is included. For the time being, I will do my best with the following procedure.
$ brew install pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ exec $SHELL
$ pyenv install 2.7.9
$ pyenv install 3.4.3
$ pyenv global 2.7.9 3.4.3
Once you've done this, the rest is as follows ...
$ python --version
Python 2.7.9
$ python2 --version
Python 2.7.9
$ python3 --version
Python 3.4.3
And you can do this.
$ pip --version
pip 6.1.1 from /Users/mypc/.pyenv/versions/2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip2 --version
pip 6.1.1 from /Users/mypc/.pyenv/versions/2.7.9/lib/python2.7/site-packages (python 2.7)
$ pip3 --version
pip 6.0.8 from /Users/mypc/.pyenv/versions/3.4.3/lib/python3.4/site-packages (python 3.4)
With this, pip can be used properly according to the version of python.
Recommended Posts