地址:https://github.com/pyenv/pyenv-virtualenv
-
Check out pyenv-virtualenv into plugin directory
$ git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
-
(OPTIONAL) Add
pyenv virtualenv-init
to your shell to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See "Activate virtualenv" below.$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
Fish shell note: Add this to your
~/.config/fish/config.fish
status --is-interactive; and source (pyenv virtualenv-init -|psub)
Zsh note: Modify your
~/.zshenv
file instead of~/.bash_profile
.Pyenv note: You may also need to add
eval "$(pyenv init -)"
to your profile if you haven't done so already. -
Restart your shell to enable pyenv-virtualenv$ exec "$SHELL"
$ exec "$SHELL"
创建virtualenv:
pyenv virtualenv venv365
进入创建的env:
pyenv activate venv365
退出env
pyenv deactivate