Last active
April 23, 2018 05:54
-
-
Save nareshganesan/cae6cc6587d439fa7fa4707b77a86aba to your computer and use it in GitHub Desktop.
macOS Sierra installing python 2 and python 3 alongside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew update | |
# installs pyenv | |
brew install pyenv | |
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile; | |
# activates pyenv | |
source ~/.bash_profile | |
# installs pyenv-virtualenvwrapper | |
brew install pyenv-virtualenvwrapper | |
echo 'export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"' | |
echo 'export WORKON_HOME=$HOME/.pyenvs' | |
echo 'pyenv virtualenvwrapper_lazy' | |
# activates pyenv-virtualenvwrapper | |
source ~/.bash_profile | |
## Usage : | |
# pyenv versions # lists the versions of python installed | |
# pyenv install 2.7.12 # installs python 2.7.12 | |
# pyenv install 3.5.2 # installs python 3.5.2 | |
# pyenv global 3.5.2 # links python 3.5.2 as system wide global python | |
# pyenv local 2.7.12 # links python 2.7.12 as version specific to $PWD | |
# usual virtualenvwrapper commands | |
# mkvirtualenv Env # creates a new python virtualenv named 'Env' | |
# deactivate # deactivates the current active virtualenv | |
# workon Env # activates python virtualenv Env | |
pyenv activate talentx | |
pyenv deactivate talentx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment