Notebooks that use the default Docker Images will automatically install a pre-set list of packages when the server is started. This article shows you how to install additional custom packages. For more information on docker images, see Notebooks and Docker Images
Viewing Default Packages
In order to view the list of packages that are installed by default from Civis-maintained docker images, click the "Packages" icon on the top right of the Notebook.
This will open up a pane on the right where you can see a list of packages.
Adding Custom Packages
Python
To install custom packages in a Python Notebook, you can execute the “pip install” command in a notebook:
!pip install <package name>
Note the exclamation point “!”, which signals that this is a shell command and not Python code.
R
To install packages in R, you will first need to start the Notebook and then install them from within the Notebook itself. Below is some sample R code for doing this.
# install a single package:
install.packages("INSERT PACKAGE NAME")
# install multiple packages:
install.packages(c("PACKAGE_1","PACKAGE_2","PACKAGE_3","PACKAGE_4"))
Comments
0 comments
Please sign in to leave a comment.