You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been successful in building it and running it with jupyter-lite but I was unsuccssfull running with jupyter-lanb
Is it possible to run it with jupyter-lab?
You cannot install the jupyter lite (wasm) and jupyter lab (native) versions in the same environment. The xeus-cpp kernels are built for different platforms. You need to have them in separate environments like in the readme instructions.
I've found the issue: it seems that xeus-cpp has interaction issues with the jupyterlab extension: jupyterlab-mathjax3-web
If I don't install it, it works
Almost.
I've tried many things and finally I've built gcc-15.1.0 and set it as the default compiler (as I needed a more comprehensive implementation of C++23). I've also reverted to the conda version.
It worked fine at the exception of the output streams. It was the initial issue I had. Every time I use for example "std::cout", it crashes.
I've replaced the streams by "std::print" & co. And now it's working.
The problem seemed to be with the "jupyterlab-mathjax3-web" extension
I've read many times that JupyterLab was using MathJax version 2 and not the version 3. I needed the version 3 in order to be able to use LaTeX packages like physics. The other extension "jupyterlab-mathjax3" didn't seem to support Mathjax commands like "\require{physics}"
After more digging, I've discovered that the latest version of JupyterLab is in fact using MathJax3.2 by default!
So, I removed the extension and now I can use C++ iostreams!
I think that all these extensions were the predecessors of the actual implementation and should not be used at all
Activity
mcbarton commentedon Jul 16, 2025
@sweinst Yes it does work with Jupyter Lab. If you follow the instructions here https://github.com/compiler-research/xeus-cpp#installation-within-a-mamba-environment-non-wasm-build-instructions , then you should be able to try it out locally in Jupyter Lab. If you cannot get it working in Jupyter Lab locally, then you can try it out in Jupyter Lab using the binder link here https://github.com/compiler-research/xeus-cpp#trying-it-online (click on the image)
sweinst commentedon Jul 16, 2025
I've tried
mcbarton commentedon Jul 16, 2025
You cannot install the jupyter lite (wasm) and jupyter lab (native) versions in the same environment. The xeus-cpp kernels are built for different platforms. You need to have them in separate environments like in the readme instructions.
sweinst commentedon Jul 18, 2025
I've found the issue: it seems that xeus-cpp has interaction issues with the jupyterlab extension: jupyterlab-mathjax3-web
If I don't install it, it works
anutosh491 commentedon Jul 18, 2025
Hmm, hearing this for the first time. Do you have an error log or something that we can see ?
anutosh491 commentedon Aug 20, 2025
cc @sweinst
Were you able to get past your error ?
sweinst commentedon Aug 20, 2025
Almost.
I've tried many things and finally I've built gcc-15.1.0 and set it as the default compiler (as I needed a more comprehensive implementation of C++23). I've also reverted to the conda version.
It worked fine at the exception of the output streams. It was the initial issue I had. Every time I use for example "std::cout", it crashes.
I've replaced the streams by "std::print" & co. And now it's working.
anutosh491 commentedon Aug 21, 2025
Would you like to educate us with your use case ? Probably we might be able to assist you better !
cc @sweinst
sweinst commentedon Aug 21, 2025
Sure.
First my configuration:
When I try to run:
I get the error:
The jupyterlab logs only show that it has lost connection with the kernel.
But
works fine!
sweinst commentedon Aug 21, 2025
BTW, at the exception of the iostreams, all the rest seem to work fine. I can run far more complex examples if I don't use iostreams
sweinst commentedon Sep 12, 2025
I've finally got a working version...
The problem seemed to be with the "jupyterlab-mathjax3-web" extension
I've read many times that JupyterLab was using MathJax version 2 and not the version 3. I needed the version 3 in order to be able to use LaTeX packages like physics. The other extension "jupyterlab-mathjax3" didn't seem to support Mathjax commands like "\require{physics}"
After more digging, I've discovered that the latest version of JupyterLab is in fact using MathJax3.2 by default!
So, I removed the extension and now I can use C++ iostreams!
I think that all these extensions were the predecessors of the actual implementation and should not be used at all
anutosh491 commentedon Sep 12, 2025
Hmm, I haven't experienced this before. If you know the problem and have a working solution, maybe raise a Pr ?