1 2
| curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash export PYENV_VIRTUALENV_DISABLE_PROMPT=1
|
查看本机安装 Python 版本
查看可安装 Python 版本
python 安装与卸载
1 2
| $ pyenv install 2.7.3 $ pyenv uninstall 2.7.3
|
python切换
1 2
| $ pyenv global 2.7.3 $ pyenv local 2.7.3
|
创建虚拟环境
1
| $ pyenv virtualenv 2.7.10 env-2.7.10
|
列出当前虚拟环境
1 2 3
| pyenv virtualenvs pyenv activate env-name pyenv deactivate
|
删除虚拟环境
1 2
| pyenv uninstall my-virtual-env rm -rf ~/.pyenv/versions/env-name
|
更换 pip 源
1 2 3 4 5 6
| vim ~/.pip/pip.conf [global] index-url = http://mirrors.aliyun.com/pypi/simple/
[install] trusted-host=mirrors.aliyun.com
|
http://einverne.github.io/post/2017/04/pyenv.html