安装pyenv
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
或直接从https://github.com/yyuu/pyenv-installer/blob/master/bin/pyenv-installer
得到bash脚本执行
更新~/.bash_profile
export PATH="/Users/$USER/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
安装python
pyenv update
pyenv install 3.5.1
pyenv global 3.5.1
python -V
之后是测试
hello.py
import scipy
print "hello"
Gemfile.txt
NumPy
SciPy
pip install --upgrade pip
pip install -r Gemfile.txt
python hello.py