Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I am a Windows user and I have been trying to install cadabra2 for some time. After attempting to install using both available wizards (-f and -g versions), and failing, I decided to try the installation on the Windows Subsystem for Linux (WSL), running Ubuntu 18.04.

Firstly I tried to install from source and downloaded the needed components from github, following the instructions Kasper wrote there. Cadabra2 works just fine from command line, but the graphic interface cadabra2-gtk freezes whenever I try to compile the code (on the other hand I can edit/open/save notebooks). (I need to use a virtual display to access the user interface from WSL).

Then I tried to install jupyter and run cadabra2 from the cadabra-jupyter-kernel. The same problem occurs: attempting to launch commands that require the cadabra kernel to run result in a connection error and the notebook staying idle.

Other attempts: I tried to uninstall and reinstall everything via miniconda/anaconda. Amusingly enough, I cannot run conda install cadabra2 from the "home" environment, which results in a failure to properly detect the environment, but I need to create a new environment. In the end I obtaining analogous results as from the installation from source both for cadabra2-gtk and jupyter notebook.

I also tried disabling the Windows firewall, but to no avail.

I really would like to use cadabra2, since it really looks awesome, but I keep stumbling on different installation issues... Please help!

in Installation trouble by (210 points)

Since you're the 2nd person in a week to ask about running Cadabra on top of WSL I'll have a look; give me a few hours to install WSL 2 myself somewhere.

I have verified that the Cadabra2 package for Ubuntu 18.04 runs under WSL 2, that is, the Jupyter kernel for Cadabra runs and can be used from a browser on the Windows side. Will post instructions tomorrow.

Thanks a lot! I really look forward to it!

I also have the graphical notebook working on WSL2 with VcXsrv, using an Ubuntu 18.04 installation and the cadabra2-2.3.2-bionic.deb package from the download page.

One thing I had to do was to install the texlive package which provides ytableau.sty, so

sudo apt install texlive-science

Otherwise the notebook would hang indefinitely when trying to evaluate a cell (it hangs on typesetting the output cell actually, not on evaluating it).

Can you try installing that package above to see if this improves things?

After installing texlive-science I can indeed run cadabra2-gtk smoothly! So the problem there was probably with the young tableaux package.

The connection problem with jupyter instead persists (both opening the jupyter notebook from the WSL side and from the Windows side).

It would be nice to be able to use jupyter too, but at least now "plain" cadabra works!!!

The problem was that, for some reason I do not understand yet, TeX would not stop on encountering that missing ytableau package, but instead hang with a prompt. This used to work fine; I do not know what changed it. I have added some additional logic now to catch this situation (if you run current github master without having the ytableau package you will get a TeX error, not a hang).

I had problems launching the cadabra kernel in jupyter notebook, then I used it in WSL with Ubuntu 20.04, the terminal writes the following errors:

[I 16:58:47.156 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/dist-packages/cadabra2_jupyter/__main__.py", line 1, in <module>
    from ipykernel.kernelapp import IPKernelApp
ModuleNotFoundError: No module named 'ipykernel'
[I 16:58:50.187 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/dist-packages/cadabra2_jupyter/__main__.py", line 1, in <module>
    from ipykernel.kernelapp import IPKernelApp
ModuleNotFoundError: No module named 'ipykernel'
[I 16:58:53.223 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/dist-packages/cadabra2_jupyter/__main__.py", line 1, in <module>
    from ipykernel.kernelapp import IPKernelApp
ModuleNotFoundError: No module named 'ipykernel'
[I 16:58:56.255 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/dist-packages/cadabra2_jupyter/__main__.py", line 1, in <module>
    from ipykernel.kernelapp import IPKernelApp
ModuleNotFoundError: No module named 'ipykernel'
[W 16:58:59.286 NotebookApp] KernelRestarter: restart failed
[W 16:58:59.287 NotebookApp] Kernel 223785de-f6fd-410f-9f0f-c335a46eeae2 died, removing from map.
[W 16:59:44.491 NotebookApp] Timeout waiting for kernel_info reply from 223785de-f6fd-410f-9f0f-c335a46eeae2
[E 16:59:44.496 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 223785de-f6fd-410f-9f0f-c335a46eeae2)
[W 16:59:46.527 NotebookApp] 404 GET /api/kernels/223785de-f6fd-410f-9f0f-c335a46eeae2/channels?session_id=54b01b8891fc4a6db4ab414b0d1bdbaa (127.0.0.1): Kernel does not exist: 223785de-f6fd-410f-9f0f-c335a46eeae2
[W 16:59:46.600 NotebookApp] 404 GET /api/kernels/223785de-f6fd-410f-9f0f-c335a46eeae2/channels?session_id=54b01b8891fc4a6db4ab414b0d1bdbaa (127.0.0.1) 78.57ms referer=None
[W 16:59:49.523 NotebookApp] Replacing stale connection: 223785de-f6fd-410f-9f0f-c335a46eeae2:54b01b8891fc4a6db4ab414b0d1bdbaa

I tried to reinstall ipykernel, but conda says that it is ok:

conda install ipykernel
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

I had the same issue with ipykernel on a ubuntu system. The solution was to run the command sudo apt install python3-ipykernel

I think the reason for the issue is that jupyter is installed via conda-forge, and conda is using a different python package than the version on which cadabra is compiled. This is because anaconda installs its default python package (at this time it is 3.8.8) at different location than the python3 and python3-dev (at this point it's 3.9.x) that is installed when you build cadabra.

Also, in the kernel configuration for conda2 on jupyter-lab, the configuration file uses /usr/bin/python3 which is different than the python installation that is used by Python on jupyter-lab.

So installing ipykernel via conda is irrelevant.

I think that "python3-ipykernel" package should be added to the prerequisite packages list on linux that is listed on github page.

1 Answer

+1 vote

I am a Windows user too. I suggest you to create an Ubuntu virtual machine using VM ware on top of which install Ubuntu 20.04 (lts). The last two versions of Cadabra2 for Ubuntu 20.04 should run without any problems.

by (190 points)

I tried that, in the meantime. I find the exact same behavior I get in the WSL. I am obviously getting something wrong...

Are you trying to build it from source? I downloaded and installed v. 2.3.1 and it currently works fine.

Yeah, I was trying to build from source.

I then tried to install it from the Ubuntu installer (.deb). After installation I could indeed open cadabra but whenever I compiled I got a LaTeX error. I eventually solved it by installing the full TeXLive distribution (texlive-full): the problem, as pointed out by Kasper, was with the package for Young tableaux, so it should be sufficient to install texlive-science.

To summarize what I got (merging with the comments above as well):

  1. cadabra2-gtk works on a Ubuntu 20.04 virtual machine (running on VM ware) after installing from the Ubuntu installer (.deb package) and upgrading the tex distribution to texlive-full (but texlive-science should be sufficient).

  2. cadabra2-gtk works on a WSL running Ubuntu 18.04 (using VcXsrv to access the graphical interface) after installing from the Ubuntu installer (.deb package) and upgrading the tex distribution to texlive-science.

...