Created
November 8, 2016 11:05
-
-
Save oogali/8f29d4e896ff3602694ce625589136d8 to your computer and use it in GitHub Desktop.
Python + OS X bash_profile...
This file contains 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
if [ -d "${HOME}/Library/Python/2.7" ]; then | |
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin" | |
fi | |
function frameworkpython { | |
if [[ ! -z "$VIRTUAL_ENV" ]]; then | |
PYTHONHOME=$VIRTUAL_ENV /usr/bin/python "$@" | |
else | |
/usr/bin/python "$@" | |
fi | |
} | |
function jupyter { | |
jcmd=$1 | |
shift | |
if [[ ! -z "$VIRTUAL_ENV" ]]; then | |
jupyter_prefix="${VIRTUAL_ENV}/bin/jupyter" | |
else | |
jupyter_prefix="$(which jupyter)" | |
fi | |
if [[ -z "${jupyter_prefix}" ]]; then | |
echo "Could not find Jupyter in your path" | |
exit 1 | |
fi | |
frameworkpython "${jupyter_prefix}-${jcmd}" "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment