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

I'm trying to install Cadabra on my Ubuntu 22.04 LTS (GNU/Linux 5.15.0-94-generic x86_64) server and I want to have jupyter notebook working on this remote server so that it is capable for me to connect to it via http://[my server ip]:[port]/tree. Having finished steps given on https://cadabra.science/download.htmlfor CONDA, I've checked by conda list and it seems to have been installed correctly. However, according to the INSTALLATION on https://cadabra.science/jupyter.html, there should be some jupyter files in /root/anaconda3/envs/cadabra37/lib/python3.7/site-packages, but I can not find them at all. And the jupyter notebook command doesn't work as well.

I've tried python=3.8, during which I was stuck by the same problem. I've also tried to install jupyter-core of conda, it did work but no Cadabra features showed up.

Could you please have a check of the log(some of the log has been deleted due to the limitation of number of words) below and give me some advice?

Thank you very much!

(base) root@VM-16-2-ubuntu:~/anaconda3/envs/cadabra/lib/python3.8/site-packages# conda create -n cadabra37 python=3.7
(base) root@VM-16-2-ubuntu:~/anaconda3# conda activate cadabra37
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# conda install cadabra2
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# conda install cadabra2-gtk
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# glib-compile-schemas "/root/anaconda3/envs/cadabra37/share/glib-2.0/schemas"
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# gtk-update-icon-cache -f -t "/root/anaconda3/envs/cadabra37/share/icons/hicolor"
gtk-update-icon-cache: Cache file created successfully.
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# gtk-query-immodules-3.0 --update-cachegtk-query-immodules-3.0: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# gtk-query-immodules-2.0 --update-cachegtk-query-immodules-2.0: command not found
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# conda install cadabra2-jupyter-kernel
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# conda list
# packages in environment at /root/anaconda3/envs/cadabra37:
#
# Name                    Version                   Build  Channel
...
cadabra2                  2.3.0            py37h5c3c4bb_8    conda-forge
cadabra2-gtk              2.3.0            py37h38dc8d5_8    conda-forge
cadabra2-jupyter-kernel   2.3.0            py37h4249f5e_8    conda-forge
...
(cadabra37) root@VM-16-2-ubuntu:~/anaconda3# jupyter notebook
Command 'jupyter' not found, but can be installed with:
apt install jupyter-core
in Installation trouble by (170 points)

1 Answer

0 votes

First of all, I would strongly advise you not to run anything like this as root user, that's just asking for trouble. It's not the cause of the problem you are having, but still important advice.

The Conda package maintainer has unfortunately abandoned it, and therefore there has not been any update for a long time. You are far better off just installing an Ubuntu package for Cadabra for Ubuntu from the download page; those are provided by me and maintained. And it is also what is written on https://cadabra.science/jupyter.html . I would remove the Conda packages first before you try this though.

Let me know if this gets you any further.

by (80.3k points)

Thanks for your comment! I've installed cadabra2-2.4.5.2-jammy.deb successfully. But I still can't start jupyter notebook. What might be the reason for that? Besides, shall I create a conda environment with cadabra files connected so that maybe I could manage more modules conveniently?

Here is the log:

...
texhash: Updating /usr/local/share/texmf/ls-R... 
texhash: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... 
texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN... 
texhash: Updating /var/lib/texmf/ls-R... 
texhash: Done.
gtk-update-icon-cache: Cache file created successfully.
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.10.2-1) ...
ubuntu@VM-16-2-ubuntu:~$ jupyter notebook
Command 'jupyter' not found, but can be installed with:
sudo snap install jupyter       # version 1.0.0, or
sudo apt  install jupyter-core  # version 4.9.1-1
See 'snap info jupyter' for additional versions.

The answer is at the end. The Cadabra package does not include Jupyter itself, you need to install that with

sudo apt install jupyter-core

(do not use the 'snap' version).

Don't use conda (at all) if you can avoid it. Practically everything you need is in Ubuntu repositories already, and if it isn't, pip plays much nicer with the rest of an Ubuntu system than conda.

Now I'm able to connect cadabra2 kernel in my jupyter notebook. However, when I type some code, for example, ex:= A_{a b} B_{b c};and then run it, no tex form output shows up. What I'm having in output is actually some plaintext ${}A_{a b} B_{b c}$. I'm not sure what's wrong with this.

Here is log for starting jupyter notebook on server. I've also used tex -v to make sure that texlive is installed.

ubuntu@VM-16-2-ubuntu:~$ tex -v
TeX 3.141592653 (TeX Live 2022/dev/Debian)
kpathsea version 6.3.4/dev
Copyright 2021 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
ubuntu@VM-16-2-ubuntu:~$ jupyter notebook
[I 2024-03-23 12:44:42.272 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-03-23 12:44:42.276 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-03-23 12:44:42.281 ServerApp] jupyterlab | extension was successfully linked.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'quit_button' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[W 2024-03-23 12:44:42.282 JupyterNotebookApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2024-03-23 12:44:42.285 ServerApp] notebook_dir is deprecated, use root_dir
[I 2024-03-23 12:44:42.285 ServerApp] notebook | extension was successfully linked.
[I 2024-03-23 12:44:42.487 ServerApp] notebook_shim | extension was successfully linked.
[I 2024-03-23 12:44:42.500 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-03-23 12:44:42.502 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-03-23 12:44:42.503 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-03-23 12:44:42.504 LabApp] JupyterLab extension loaded from /home/ubuntu/.local/lib/python3.10/site-packages/jupyterlab
[I 2024-03-23 12:44:42.504 LabApp] JupyterLab application directory is /home/ubuntu/.local/share/jupyter/lab
[I 2024-03-23 12:44:42.505 LabApp] Extension Manager is 'pypi'.
[I 2024-03-23 12:44:42.554 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-03-23 12:44:42.557 ServerApp] notebook | extension was successfully loaded.
[I 2024-03-23 12:44:42.557 ServerApp] Serving notebooks from local directory: /home/ubuntu
[I 2024-03-23 12:44:42.557 ServerApp] Jupyter Server 2.13.0 is running at:
[I 2024-03-23 12:44:42.557 ServerApp] http://VM-16-2-ubuntu:52598/tree?token=1f45dd88be473a49ee67aed69e97a5ceb6bda5dd3b94515a
[I 2024-03-23 12:44:42.557 ServerApp]     http://127.0.0.1:52598/tree?token=1f45dd88be473a49ee67aed69e97a5ceb6bda5dd3b94515a
[I 2024-03-23 12:44:42.557 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2024-03-23 12:44:42.561 ServerApp] No web browser found: Error('could not locate runnable browser').
[C 2024-03-23 12:44:42.561 ServerApp] 

    To access the server, open this file in a browser:
        file:///home/ubuntu/.local/share/jupyter/runtime/jpserver-7271-open.html
    Or copy and paste one of these URLs:
        http://VM-16-2-ubuntu:52598/tree?token=1f45dd88be473a49ee67aed69e97a5ceb6bda5dd3b94515a
        http://127.0.0.1:52598/tree?token=1f45dd88be473a49ee67aed69e97a5ceb6bda5dd3b94515a
[I 2024-03-23 12:44:42.575 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[I 2024-03-23 12:44:56.846 ServerApp] Kernel started: bf2395a7-b9cf-417b-aba7-0766f0489b34
[I 2024-03-23 12:44:58.219 ServerApp] Connecting to kernel bf2395a7-b9cf-417b-aba7-0766f0489b34.
[IPKernelApp] WARNING | Unknown message type: 'comm_open'
[IPKernelApp] WARNING | Unknown message type: 'comm_msg'

Just now I tried opening the file in JupyterLab instead of Notebook and this time it did work gracefully, so I guess this problem has been solved (though I'm still a little puzzled about if it is the case that I have to use JupyterLab rather than Notebook).

Thank you very much for your patient guidance!

...