Follow below steps to install and use new packages.
!sudo pip3 install matplotlib
Note: Don’t forget to use sudo in the above command.
The package matplotlib is now available to all the users in the JupyterHub. If a user already had a python notebook running, they have to restart their notebook’s kernel to make the new libraries available.
You can also install new packages using pip3 command in SSH Terminal as follows.
sudo pip3 install packagename
Alternatively, you can open the terminal from JupyterLab and install the package using same pip3 command.