Environment: Mac OS X 10.9.4 (Mavericks) Assumption: homebrew installed
$ brew install pyenv-virtualenv pyenv
Add the following to ~ / .bashrc
and ~ / .zshrc
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
fi
After adding, execute the following
$ source ~/.zshrc
If you execute the following command and the version of pyenv is displayed, it is successful
$ pyenv -v
pyenv 20140705
Added a guy who automates pyenv rehash
(although not required). rehash It's easy to forget so put it in
git clone https://github.com/yyuu/pyenv-pip-rehash.git ~/.pyenv/plugins/pyenv-pip-rehash
$ pyenv install -l
$ pyenv install 3.4.1
$ pyenv versions
The specified version is used as a whole.
$ pyenv global 3.4.1
The specified version is used directly under that directory.
$ pyenv local 3.4.1
$ pyenv uninstall 3.4.1
Hello World
Save the following as hello.py
print("Hello World")
Try to run
$ python hello.py
Hello World
I heard a rumor from Homebrew that Ricty (fontforge) cannot be installed when using Python3 system with pyenv. I haven't verified it, but for the time being, it's a memo. http://d.hatena.ne.jp/riocampos+tech/20140406/pyenv_must_be_set_python2_as_python
Recommended Posts