jupyter-xeus / xeus-cling

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
3.01k stars 294 forks source link

Getting nteract to find xeus-cling requires additional work #176

Open jzf2101 opened 5 years ago

jzf2101 commented 5 years ago

@rgbkrk and I are trying to get xeus on the nteract website but the way xeus installs intself doesn't allow us to easily get the kernels picked up by nteract. one has to call:

source activate cling
python -m ipykernel install --user --name cling --display-name "C++ (xeus-cling)" 

to get it to work. Is there a way we can automate this?

rgbkrk commented 5 years ago

It just dawned on me that this installs a python kernel from the cling environment rather than setting up the kernel.json to be accessible outside the conda environment.

SylvainCorlay commented 5 years ago

FYI the xeus-cling kernel installs its kernel spec into installation prefix/environment.

rgbkrk commented 5 years ago

Sadly, at least for all node driven frontends, we are not able to see conda environments because we're not launched as a python process. If a kernel.json can (optionally) be installed into e.g. ~/Library/Jupyter/kernels/cling/kernel.json, even if it's referencing that conda environment, then we can detect it. Because of the nature of native applications, especially on mac, this is a bit of a hard requirement for us.

This all isn't to say we wouldn't ❤️ to be able to detect kernels in conda environments -- we got some pushback on auto-detecting conda environments on desktop (from current users).

SylvainCorlay commented 5 years ago

Yeah, i was just mentioning it in case you were running the server in the same environment (for a local run / trying out the kernel).

So you are stuck with the installation of the kernel spec...

rgbkrk commented 5 years ago

Yeah. We're not really stuck, because we can craft the kernel.json by hand. We want to add C++ to the nteract kernels page as a simple set of instructions, largely for desktop users. For nteract web users, it's the same jupyter server so that works out of the box.

Current PR: https://github.com/nteract/nteract.io/pull/45

Live Demo of that PR: https://nteractio-ceydcgfmjt.now.sh/kernels/c++

SylvainCorlay commented 5 years ago

There is a kernel.json installed with the package, including an absolute path to the kernel (relocated by conda).

Also, if you are building from source, we have a cmake option for installing the kernel json in an extra location.

jzf2101 commented 5 years ago

I think my question was that the kernel.json isn't something nteract can see since the enviornment has to be activated first to get access to it. That's why I've written the additional ipykernel install line after it