start_jupyter.sh 499 B

123456789101112131415161718
  1. #!/bin/bash
  2. # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
  3. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  4. SETUP_PY_ENV=$DIR/env/activate_python_env.sh
  5. EXAMPLE_PY_ENV=$DIR/env/activate_python_env_EXAMPLE.sh
  6. if [ -f $SETUP_PY_ENV ]
  7. then
  8. . $SETUP_PY_ENV
  9. cd $DIR/python
  10. PYTHONPATH=$DIR/python jupyter notebook
  11. else
  12. echo "$SETUP_PY_ENV not found. You can use $EXAMPLE_PY_ENV as a starting point for your own." 1>&2
  13. exit 1
  14. fi