DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/ Requirement already satisfied: virtualenv in /Library/Python/2.7/site-packages (16.4.3) WARNING: You are using pip version 19.1.1, however version 20.1.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. New python executable in /Users/xiexiang/.pyenv/versions/erp.27/bin/python Installing setuptools, pip, wheel... done. Looking in links: /var/folders/g1/11wx0xn9003_cwy38pnp0qzc0000gn/T/tmp5N31aZ Requirement already satisfied: setuptools in /Users/xiexiang/.pyenv/versions/erp.27/lib/python2.7/site-packages (44.1.0) Requirement already satisfied: pip in /Users/xiexiang/.pyenv/versions/erp.27/lib/python2.7/site-packages (20.1.1)
查看工作虚拟环境
1 2 3 4 5
pyenv virtualenvs
3.6.8/envs/api.mer.36 (created from /Users/xiexiang/.pyenv/versions/3.6.8) api.mer.36 (created from /Users/xiexiang/.pyenv/versions/3.6.8) erp.27 (created from /System/Library/Frameworks/Python.framework/Versions/2.7)
激活工作虚拟环境
1
pyenv activate erp.27
** 自测遇到的问题,会报出如下的错误,这时候我重启了命令器也没有作用
解决方式:需要在~/.zshrc下加入以下内容
1 2 3 4 5
# pyenv config export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval"$(/usr/local/bin/pyenv init -)" if which pyenv > /dev/null; then eval"$(pyenv init -)"; fi