IPython Notebook doesn't see environment variables with "bash magic" -


i running ipython notebook on vagrant virtual machine, , port-forwarding local machine can view notebook in web browser. run bootstrap script sets an environment variable jython_home in /etc/environment with:

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

the boot script later starts ipython notebook. when open 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 empty line.

i have tried append export line ~/.profile, /.profile, ~/.bashrc, , etc/profile, same result. know notebook operating root, can't seem able see environment variable. can include in boostrapping script remedy this?

i needed export variable in 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 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -