1

I am running IPython Notebook on a vagrant virtual machine, and port-forwarding to my local machine so that I can view the notebook in my web browser. I run a bootstrap script that sets an an environment variable JYTHON_HOME in my /etc/environment with:

sudo echo "JYTHON_HOME=/usr/lib/jvm/jython" | sudo tee -a /etc/environment
source /etc/environment

The boot script later starts up ipython notebook. When I open up the notebook,

%%bash
cat /etc/environment

yeilds

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
JYTHON_HOME=/usr/lib/jvm/jython

but

%%bash
echo $JYTHON_HOME

prints an empty line.

I have also tried to append the export line to ~/.profile, /.profile, ~/.bashrc, and etc/profile, all with the same result. I know that the notebook is operating as root, but I can't seem to be able to get it to see my environment variable. What can I include in my boostrapping script that will remedy this?

1 Answer 1

2

I needed to actually export the variable in the script itself.

sudo echo "JYTHON_HOME=/usr/lib/jvm/jython" | sudo tee -a /etc/environment
source /etc/environment
export JYTHON_HOME=/usr/lib/jvm/jython
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.