mirror of https://github.com/jlizier/jidt
Further refinements to python environment start code
This commit is contained in:
parent
107fabad32
commit
f55737c650
|
@ -26,7 +26,9 @@ folder=jpype_env
|
||||||
source $folder/bin/activate
|
source $folder/bin/activate
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Virtual environment unable to be activated" >&2
|
echo "Virtual environment unable to be activated" >&2
|
||||||
return 3 # Need return instead of exit since we're running via source
|
# Try return first in case this script was sourced.
|
||||||
|
return 3 2>/dev/null
|
||||||
|
exit 3
|
||||||
else
|
else
|
||||||
echo "Python environment from $folder started and activated."
|
echo "Python environment from $folder started and activated."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,9 +20,21 @@
|
||||||
# Start the python environment (stored in folder $folder) with jpype1, numpy and others installed
|
# Start the python environment (stored in folder $folder) with jpype1, numpy and others installed
|
||||||
# and then launch jupyter
|
# and then launch jupyter
|
||||||
|
|
||||||
source start_env.sh
|
# Name of folder to use and python commands
|
||||||
|
folder=jpype_env
|
||||||
|
|
||||||
|
# enter the environment
|
||||||
|
source $folder/bin/activate
|
||||||
|
|
||||||
|
if [[ "$VIRTUAL_ENV" != "" ]]
|
||||||
|
then
|
||||||
echo "Started virtual environment, now starting jupyter ..."
|
echo "Started virtual environment, now starting jupyter ..."
|
||||||
|
else
|
||||||
|
echo "Virtual environment not started, exiting"
|
||||||
|
# Try return first in case this script was sourced.
|
||||||
|
return 1 2>/dev/null
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
jupyter notebook
|
jupyter notebook
|
||||||
|
|
Loading…
Reference in New Issue