之前浏览文章的时候偶然看到了 asdf 这个项目,然后惊讶的发现它整合了我之前经常使用的 pyenv 还有不太常用的 jenv, nvm, rvm,通过这一个命令就可以实现,所以立马在机器上试了一下。
Install
安装的过程具体可以参考官网,这里不多展开,Mac 下可以使用 Homebrew, 不过个人还是偏好使用 git clone 安装:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
然后在 ~/.zshrc
中添加:
. $HOME/.asdf/asdf.sh
Plugin
asdf 通过插件的形式可以添加不同语言的支持。支持的所用插件可以在这里 看到。
asdf plugin add python
安装具体版本:
asdf list all python
asdf install python latest
asdf install python 3.6.1
设置版本
asdf global python 3.6.1
asdf shell python 3.6.1
asdf local python 3.6.1