Go back

How to install additional packages

Follow below steps to install and use new packages.

  1. This VM comes with the default ubuntu as an admin user. So to access the Web UI and to install additional packages, Login with ubuntu user and provide the password of ubuntu user.

/img/aws/aiml/jupyter-login.png

  1. Open Jupyter Notebook and enter the below command to install the matplotlib package using pip3.
!sudo pip3 install matplotlib

Note: Don’t forget to use sudo in the above command.

/img/common/jupyterlab.png

/img/common/install-new-packages-in-notebook.png

  1. 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.

  2. You can also install new packages using pip3 command in SSH Terminal as follows.

sudo pip3 install packagename

/img/common/install-new-packages-in-terminal.png

Alternatively, you can open the terminal from JupyterLab and install the package using same pip3 command.

/img/common/jupyterlab-terminal.png

/img/common/jupyter-terminal-installation.png

  1. All the packages installed using pip3 are available under /usr/local/lib/python3.10/dist-packages/ directory.

/img/common/default-package-location.png

Go back