How can I setup custom environment variables for notebooks spawned using 
th= e systemd spawner?  I would like to be able to edit PYTHONPATH and run 
a fe= w EUPS setup commands to initialize an environment when a notebook 
spins up= . =20

 

c.SystemdSpawner.extra_paths only allows editing the PATH variable.

c.Spawner.environment[] and c.Spawner.env.update({}) aren't supported by 
th= e systemd spawner. =20 c.Spawner.env_keep isn't a viable option, as I 
have Jupyterhub running as r= oot and it needs a different environment.

 

I've tried creating a custom c.Spawner.cmd but this hasn't worked either.  = 
It looks like this:

#!/bin/bash

export PATH=3D'/opt/anaconda/bin:/opt/eups/bin:$PATH'

source /opt/lsst_stack/loadLSST.bash

source activate lsst

setup lsst_sims

exec jupyterhub-singleuser "$@"

 

But when I check the environments on the spawned notebooks they do not 
appe= ar to inherit the environment variables set by those commands.

 

I've also tried setting the environment variables in the .bashrc files for 
= each user, but these appear to be ignored by the notebooks spawned 
through = systemd (the notebooks only pickup the environment from the root 
user).

 

Cheers,

  Mark Holliman

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/20afa4e4-6c46-4499-92b7-917fee6074e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to