版本管理

Python 版本管理 #

pyenv #

pyenv 加速 #

.zshrc 添加

function pyenvinstall {
    wget -c https://npm.taobao.org/mirrors/python/$@/Python-$@.tar.xz -P ~/.pyenv/cache/
    pyenv install $@
}

执行 zsh 使配置生效, 之后即可这样安装: pyenvinstall 3.8.2

pyenv 基础命令 #

# List all available versions
pyenv install -l

# 更新
pyenv update

brew update && brew upgrade pyenv

pyenv update #

pyenv/pyenv-update Github stars Language Last Tag Last commit

git clone https://github.com/pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update

pyenv update

pyenv global 3.8.2 2.7.17 #

set by ~/.pyenv/version

3.8.2
2.7.17

pyenv shell 3.8.2 2.7.17 #

set by PYENV_VERSION environment variable

$ echo $PYENV_VERSION

3.8.2:2.7.17

pyenv 优先级 #

  • pyenv shell
    • $PYENV_VERSION
  • pyenv local
    • .python-version file
  • pyenv global
    • ~/.pyenv/version
  • System Python




本文访问量

本站总访问量

本站总访客数