G'day mate,
Did you manage to find a solution to this problem? I am in exact same shoes
as you and wouldn't want to have same env as root.
Cheers
On Friday, November 3, 2017 at 10:28:08 PM UTC+11, Mark Holliman wrote:
>
> 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 view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/a13b54cf-6380-4e0a-8e1c-d692052c7085%40googlegroups.com.