Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:advanced:jupyter [2022/03/25 16:02] – [Step 3: Install the dependencies from the Debian repos and compile the code] gkazhoyatutorials:advanced:jupyter [2022/07/06 11:40] (current) – [Step 2: Download the source code for the Jupyter Common Lisp kernel] gkazhoya
Line 9: Line 9:
 You need Python3 to install the newest version of JupyterLab. You need Python3 to install the newest version of JupyterLab.
  
-This installation was tested on Ubuntu 16.04 but should work on 18.04 and 20.04 as well.+This installation was tested on Ubuntu 16.04 and 20.04 (python 3.8).
  
  
-==== Step 1: Install JupyterLab ====+===== Step 1: Install JupyterLab =====
  
 First, if you don't have it, install pip or rather pip3: First, if you don't have it, install pip or rather pip3:
  
 <code bash> <code bash>
-$ sudo apt-get install python3-pip python3-dev+$ sudo apt install python3-pip python3-dev
 </code> </code>
  
Line 29: Line 29:
 $ jupyter-lab $ jupyter-lab
 </code> </code>
- 
-Troubleshooting: sometimes the PIP version on the Debian repos for your Ubuntu might be outdated. In that case you will see an error when calling the JupyterLab installation command, it will tell you exactly that, that your PIP version is too old. In that case, you can install pip from a different repo, like so: 
-<code bash> 
-$ curl -O https://bootstrap.pypa.io/pip/3.5/get-pip.py    # be careful with the version! I had Python 3.5, you might have newer. 
-$ sudo -E python3 get-pip.py 
-</code> 
-But maybe you should just update your Ubuntu. 
-Or maybe ask a friend or the internet to help you getting Jupyter to run. 
  
  
Line 45: Line 37:
 <code bash> <code bash>
 $ roscd && cd ../src $ roscd && cd ../src
-mkdir jupyter+catkin_create_pkg jupyter
 $ cd jupyter $ cd jupyter
-$ curl -O https://raw.githubusercontent.com/cram2/cram/jupyter/common-lisp-jupyter.rosinstall +$ curl -O https://raw.githubusercontent.com/cram2/cram/boxy-melodic/jupyter/common-lisp-jupyter.rosinstall 
-$ wstool merge common-lisp-jupyter.rosinstall && wstool update+wstool init && wstool merge common-lisp-jupyter.rosinstall && wstool update 
 +$ roscd && cd .. 
 +$ catkin_make # or catkin build if this workspace has been build like that before 
 </code> </code>
  
Line 88: Line 82:
  
  
-Troubleshooting: if you get compilation errors when loading the ASDF system of common-lisp-jupyter, it means you have version incompatibilities. On Ubuntu 16.04 the SBCL installed from the Debian repos is really old. The common-lisp-jupyter package uses a bit newer version where some packages got renamed etc. If that is the case for you, try to check out an older version of common-lisp-jupyter, the newest version that still supports Ubuntu 16.04 is as following.+===== Step 4Test if it worked =====
  
-Execute the command inside the common-lisp-jupyter Git repo:+Make sure you kill any old versions of JupyterLab that are running. Then:
  
 <code bash> <code bash>
-git checkout 689f47667ab6a4a9865776fdd159d8bbdc222f20+jupyter-lab
 </code> </code>
  
-If that still doesn't helpprobably some of the dependencies of the package introduced breaking changes. Unfortunately, the person who made the rosinstall was too lazy to write down all the commit numbers that worked for the person, so you might have to debug and see, which specifically package is causing you problems.+Inside Jupytergo to File -> New -> Notebook and in the list of Kernels you should see Common Lisp now.
  
-==== Step 4: Test if it worked ====+Have fun.
  
-Make sure you kill any old versions of JupyterLab that are running. Then:+{{ :tutorials:advanced:jupyter_cl-2022-03-25_16.43.59.mp4 |}}
  
 +
 +===== Troubleshooting =====
 +
 +=== Step 1 ===
 +
 +Sometimes the PIP version on the Debian repos for your Ubuntu might be outdated. In that case you will see an error when calling the JupyterLab installation command, it will tell you exactly that, that your PIP version is too old. In that case, you can install pip from a different repo, like so:
 <code bash> <code bash>
-jupyterlab+curl -O https://bootstrap.pypa.io/pip/3.5/get-pip.py    # be careful with the version! I had Python 3.5, you might have newer. 
 +$ sudo -E python3 get-pip.py
 </code> </code>
 +But maybe you should just update your Ubuntu. Before 20.04 python 2.7 is the default, after it's 3.6+. Check your version with 'python --version', and also your 'pip --version', because whether you install a package with pip or pip3 will only install it for the respective version.
  
-Inside Jupyter, go to File -> New -> Notebook and in the list of Kernels you should see Common Lisp now.+If there are multiple people working on the same PC and you want to install the stuff only for yourself, you can specify that with 'pip install --user <package>'.
  
-Have fun.+When the jupyter installation tells there are version requirements for certain packages you can install the specific version like this. Check the required version from your command prompt, it may be different from this. 
 +<code bash> 
 +# use pip3 instead if pip is for python2 
 +pip install --user traitlets==5.2.2.post1 
 +pip install --user ipython==7.23.1 
 +</code> 
 +That specific version of traitlets also fixes a bug with jupyter-lab. ipython can be outdated if previously installed via aptitude.
  
-{{ :tutorials:advanced:jupyter_cl-2022-03-25_16.43.59.mp4 |}} +=== Step 3 ===
-==== Appendix ====+
  
-If ASDF doesn't seem to find the non-ROS Lisp packages, something must be wrong with your workspace or you downloaded the packages outside of the ROS workspace. Maybe you need to restart your REPL or Emacs completely. You can try the command below to help ASDF find the packages, but, really, just make sure your ROS setup is clean, then you won't need any hacks like this:+If ASDF doesn't seem to find the common-lisp-jupyter package when you're loading its ASDF system, something must be wrong with your workspace or you downloaded the packages outside of the ROS workspace. Maybe you need to restart your REPL or Emacs completely. You can try the command below to help ASDF find the packages, but, really, just make sure your ROS setup is clean, then you won't need any hacks like this:
  
 <code lisp> <code lisp>
Line 125: Line 132:
   (pushnew (parse-namestring jupyter-dir-path) asdf:*central-registry* :test #'equal))   (pushnew (parse-namestring jupyter-dir-path) asdf:*central-registry* :test #'equal))
 </code> </code>
 +
 +
 +If you get compilation errors when loading the ASDF system of common-lisp-jupyter, it means you have version incompatibilities. On Ubuntu 16.04 the SBCL installed from the Debian repos is really old. The common-lisp-jupyter package uses a bit newer version where some packages got renamed etc. If that is the case for you, try to check out an older version of common-lisp-jupyter, the newest version that still supports Ubuntu 16.04 is as following. Execute the command inside the common-lisp-jupyter Git repo:
 +
 +<code bash>
 +$ git checkout 689f47667ab6a4a9865776fdd159d8bbdc222f20
 +</code>
 +
 +If that still doesn't help, probably some of the dependencies of the package introduced breaking changes. Unfortunately, the person who made the rosinstall was too lazy to write down all the commit numbers that worked for the person, so you might have to debug and see, which specifically package is causing you problems.
 +
 +
 +