Last active
March 16, 2018 01:34
-
-
Save DavidPu/a82e130039baa4e5f4af213ad41d52a6 to your computer and use it in GitHub Desktop.
manage python environment
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
| #!/bin/bash | |
| # download differnet python versions.. | |
| git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
| export PATH=~/.pyenv/bin:$PATH | |
| pyenv install 3.6.4 | |
| pyenv install 2.7.14 | |
| # create Python 3 environment: | |
| export PYTHONHOME=~/.pyenv/versions/3.6.4 | |
| ~/.pyenv/versions/3.6.4/bin/python -m venv <my_py_env_folder> | |
| source <my_py_env_folder>/bin/activate | |
| # or create Python 2 environment | |
| export PYTHONHOME=~/.pyenv/versions/2.7.14 | |
| ~/.pyenv/versions/2.7.14/bin/pip -v install virtualenv | |
| ~/.pyenv/versions/2.7.14/bin/python -m virtualenv -p ~/.pyenv/versions/2.7.14/bin/python <my_py_env_folder> | |
| source <my_py_env_folder>/bin/activate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment