user_guide:howto:jupyter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
user_guide:howto:jupyter [2020/12/17 15:04] – created jupyter instructions page lkastneruser_guide:howto:jupyter [2021/06/15 09:02] (current) – [jupyter] Try other browser lkastner
Line 2: Line 2:
 ===== Prerequisites ===== ===== Prerequisites =====
 To use polymake with jupyter it is necessary to have jupyter installed. jupyter is provided via the package manager in many linux distributions. To use polymake with jupyter it is necessary to have jupyter installed. jupyter is provided via the package manager in many linux distributions.
 +  - Ubuntu: ''sudo apt-get install python3-notebook jupyter jupyter-core''
 +  - Fedora: ''sudo dnf install python3-jupyter-core''
  
 Furthermore you need an **installed** version of polymake. This means that you need to run Furthermore you need an **installed** version of polymake. This means that you need to run
Line 7: Line 9:
 ninja -C build/Opt install ninja -C build/Opt install
 </code> </code>
-in your polymake source. Then you use the polymake binary from the folder you installed polymake in.+if working with the polymake source. Then please use the polymake binary from the folder you installed polymake in
 + 
 +If you use a version of polymake installed via your package manager, make sure you have the ''polymake-config'' binary. Try running 
 +<code> 
 +polymake-config --version 
 +</code> 
 +in a terminal. For example for Ubuntu it is not enough to have the ''polymake'' package installed, you will also need ''libpolymake-dev''.
  
 ===== Setup ===== ===== Setup =====
Line 46: Line 54:
 polymake --script jupyter --force polymake --script jupyter --force
 </code> </code>
 +
 +===== Usage =====
 +The usage of the jupyter interface is independent of polymake, so we point you to the [[https://jupyter.org/|jupyter documentation]].
 +
 +In the code blocks you may use polymake just like in the polymake shell.
 +
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
 +If the polymake kernel does not start for you, look at the output of jupyter in the terminal and search for any error messages.
 +
 +If you experience issues it makes sense to try a different browser.
 +
 +==== JuPyMake.PolymakeError: polymake::Main - /usr/lib/polymake/shared is not a symlink ====
 +This error sometimes appears with polymake installed by the package manager. It can be fixed by manually setting the symlink
 +<code>
 +cd /usr/lib/polymake
 +sudo ln -s ../../share/polymake shared
 +</code>
 +
 +
 +==== polymake configuration ====
 +The default configuration used by the jupyter kernel is the one in ''$HOME/.polymake''. If you need to reconfigure a rules file, it is easiest to reconfigure it outside of jupyter. Note that the configuration is only saved to ''$HOME/.polymake'' once polymake gets closed using ''exit;''.
 +
 +Advance users can use a different configuration folder in the following way:
 +<code>
 +alias jupymake="env POLYMAKE_USER_DIR=$HOME/.polymake-jupyter jupyter notebook --notebook-dir=$HOME/jupyter-notebooks"
 +</code>
 +
 +==== polymake kernel does not start ====
 If the polymake kernel will not start, but used to start, then please force the installation of a new kernel at startup, with If the polymake kernel will not start, but used to start, then please force the installation of a new kernel at startup, with
 <code> <code>
 polymake --script jupyter --force polymake --script jupyter --force
 </code> </code>
 +
 +==== Switching applications ====
 +If you change the polymake application in your code, then put the command for this in a separate code block in your jupyter notebook.
  • user_guide/howto/jupyter.txt
  • Last modified: 2021/06/15 09:02
  • by lkastner