I would like to try the C++ kernel in Jupyter notebooks.
I am on Ubuntu 22.04.01. The existing answer cover Windows which was not supported at the time.
I already have a bunch of conda environments, mainly Python but a couple of Julia kernels as well. I normally launch Jupyter Notebooks from the Anaconda Navigator: upon clicking on the "New" I see all these environments (Julia 1.8.1, Python 3 ipykernel, as well as the conda environments). Once the new notebook is created, I find the them all again under Kernels / change Kernel menu.
To get a C++ kernel, I followed the steps in Xeus-Cling:Run C++ code in Jupyter notebook.
To summarise:
conda create -n xeus-cling
source activate xeus-cling
hence creating and activating a new conda environment (NOTE: I tried it all again using conda activate
instead of source activate
, although I believe they should be equivalent, are they not).
Further I install Xeus-cling, as per instructions
conda install -c conda-forge xeus-cling
and that should be it. I then go
source activate xeus-cling
jupyter-notebook
but contrary to the snapshot in the article, there is not trace of any C++ kernel, nor of the recenty create Xeus-cling conda environment (which however shows up if I issue conda env list
.
When creating a new environment in the past, it would not show on the Jupyter Notebook "New" tab until ipykernel was installed, I guess this should be taken care in this case somehow by xeus-cling, but I am clearly not making it work.
If it could be of any relevance, the first time I tried the command
jupyter notebooks
got unrecognised. I installed with sudo apt
and it did open a notebook, without C++ kernels. I deactivated/deleted this environment, and upon creating a new one, the command jupyter notebooks
got recognised, which puzzled me-