文章目录
pyenv
Install Python using pyenv
To list the available versions: python install -l
pyenv install 3.7.6
Create virtual environment
pyenv virtualenv 3.7.6 .pyenv3.7.6
we can set system-wise defaults using pyenv global
pyenv global .pyenv3.7.6
Activate the environment locally
pyenv local .pyenv3.7.6
virtualenv
Create virtual env
we can use whereis
command to the path to the python version we want
virtualenv -p [path to python] .venv
and use source .venv/bin/activate
in linux and source .venv/Script/activate
in windows for activation.