Last active
August 22, 2018 23:57
-
-
Save phi-line/36cc277877ea1b6cc84798cb840aa86b to your computer and use it in GitHub Desktop.
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
| # virtualenv --python=/usr/local/bin/python2.7 <path/to/new/virtualenv/ | |
| # virtualenv --python=/usr/local/bin/python3.7 <path/to/new/virtualenv/ | |
| set_python_version() { | |
| while true; do | |
| echo -n "Please choose Python2 or Python3 (2/3): " | |
| read python_version | |
| if [ "$python_version" = "2" ]; then | |
| echo "Activating: Python 2.7 >> ~/env/bin/activate" | |
| export PYTHONPATH=/Users/username/env/lib/python2.7/site-packages:/Users/username/git | |
| source ~/env/bin/activate | |
| break | |
| elif [ "$python_version" = "3" ]; then | |
| echo "Activating: Python 3.7 >> ~/env3/bin/activate" | |
| export PYTHONPATH=/Users/username/env3/lib/python3.7/site-packages:/Users/username/git | |
| source ~/env3/bin/activate | |
| break | |
| fi | |
| done | |
| } | |
| set_python_version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment