# Jupyterhub: Kernels in different environments not working

**URL:** <https://discourse.jupyter.org/t/jupyterhub-kernels-in-different-environments-not-working/20425>\
**Category:** Kernels\
**Tags:** jupyterlab, jupyterhub\
**Created:** [July 15, 2023, 9:55am UTC](https://discourse.jupyter.org/t/jupyterhub-kernels-in-different-environments-not-working/20425 "2023-07-15T09:55:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gizmo11](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gizmo11/32/10458_2.png) [@gizmo11](https://discourse.jupyter.org/u/gizmo11)\
**Post date:** [July 15, 2023, 9:55am UTC](https://discourse.jupyter.org/t/jupyterhub-kernels-in-different-environments-not-working/20425/1 "2023-07-15T09:55:29Z")

</div>

Hi,  
I’m not able to get xeus-cling- and R-kernel to work in jupyterlab or notebook startet from jupyterhub.  
My system : Ubuntu 22.04 with miniconda3 installed in /opt.  
I have an environment for jupyterhub (jupyterhubenv) and one for xeus-cling (xeusclingenv) and one for R (R-env).  
It works, when I install “nb\_conda\_kernels” and start the jupyterhub in the jupyterhubenv-console. But when I start jupyterhub over systemd, then all kernels disappear. I tried also to start a bash-script with systemd, in which I activated the jupyterhubenv before I startet jupytherhub. But also without success.

Another way: I tried to install the kernels manually like this:

`(jupyterhubenv): jupyter kernelspec install /opt/miniconda3/envs/xeus-cling/share/jupyter/kernels/xcpp14/ --sys-prefix`

then the kernels are all listet in jupyterlab, but can not be executed. It crashes with errors like

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!  
Invoking:  
LC\_ALL=C x86\_64-conda-linux-gnu-c++ -O3 -DNDEBUG -xc++ -E -v /dev/null 2\>&1 | sed -n -e ‘/^.include/,${’ -e ‘/^ /.\*++/p’ -e ‘}’  
Results was:  
With exit code 0  
input\_line\_1:1:10: fatal error: ‘new’ file not found  
#include

What I want is to start jupyterhub as a systemd-service and all kernels from different environments to work. I would prefer the manual way instead of “nb\_conda\_kernels”  
I’m new to all this stuff, but got the task, to provide a jupyterhub-server.

Thanks in advance

Thomas

---

<div class="post-metadata">

**Author:** ![gizmo11](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gizmo11/32/10458_2.png) [@gizmo11](https://discourse.jupyter.org/u/gizmo11)\
**Post date:** [July 16, 2023, 3:56pm UTC](https://discourse.jupyter.org/t/jupyterhub-kernels-in-different-environments-not-working/20425/2 "2023-07-16T15:56:31Z")

</div>

I’m a few steps further … I activated my xeusclingenv and executed the command  
xcpp --verbose  
So I could see all the includes xcpp uses. I opened the file

/opt/miniconda3/envs/jupyterhubenv/share/jupyter/kernels/xcpp17/kernel.json

which was created by the “jupyter kernelspec install”-command and attached all this includes  
like this  
“argv”: [  
“/opt/miniconda3/envs/xeus-cling/bin//xcpp”,  
.  
.  
“-I”,  
“/opt/miniconda3/envs/xeus-cling/include”

and now the xcpp17-kernel seems to work.

The same was with the kernel for R. I installed into the jupyterenv again with

jupyter kernelspec install /opt/miniconda3/envs/R\_env/share/jupyter/kernels/ir/ --sys-prefix

and had to edit the kernel,json.  
There was only the R-coomand. I needed to attach the full path to the R-command.

Do I miss a step installing kernels into the jupyterhubenv ? Or is this the “normal” way, that the created kernel.json has to be adapted ?

Thomas
