Installing numpy on Jupyterlab hosted on Yunohost

I’m self-hosting a Jupyterlab instance with Yunohost, but one annoying thing is that packages like numpy are not installed by default.

import numpy as np
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import numpy as np

ModuleNotFoundError: No module named 'numpy'

Here is a way to install python packages

!/opt/jupyterlab/venv/bin/python -m pip install numpy

try to import again, no error message showed up:

import numpy as np
np.pi
3.141592653589793

Python cheat sheet
Ultimate Python Cheatsheet :fire:.pdf|attachment (2.3 MB)