How do I install a previous version of Python into a virtualenv? -
this question has answer here:
i had python3 installed globally, made virtualenv. want change python version inside python2.7. trying install python2.7 gives me option of installing hard disk. how can specify version in virtualenv?
first , foremost, is. if take @ virtualenv --help
, see have option specify python
executable using -p
flag. however, problem different since have python3
linked python
executable. in another question is talked about. however, isn't anwer since involves making, , symlinking new python installation.
instead, better use python version manage live pyenv
or pythonz
. myself prefer pyenv
. if on *nix machine, follow instructions outlined here.
once installation complete, should see few instructions towards end of installation.
# load pyenv automatically adding # following ~/.zshrc: export path="$home/.pyenv/bin:$path" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
simply @ end of .bashrc or .zshrc. if you're using windows, process lot harder. there pip
installer. however, please note not stable yet.
once of done, need install version of python want.
pyenv install 2.7.10
once done, run pyenv rehash
, run pyenv global <version installed>
(which maybe different 2.7.10).
now can go ahead create virtual environment virtualenv
, , should have version of python want.
Comments
Post a Comment