Install packages from within Azure Notebooks Preview

Important

On January 15, 2021 the Azure Notebooks public preview site will be retired and replaced with integrated services from Visual Studio, Azure, and GitHub. To create new or execute notebook content, learn more about our other notebooks experiences from Microsoft.

This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

Although you can configure the environment for your notebook on the project level, you may want to install packages directly within an individual notebook.

Packages installed from the notebook apply only to the current server session. Package installations aren't persisted once the server is shut down.

Python

Packages in Python can be installed using either pip or conda using commands within code cells:

!pip install <package_name>

!conda install <package_name> -y

If the command output indicates that the requirement is already satisfied, then Azure Notebooks may include the package by default. The package might also be installed through a project environment setup step.

R

Packages in R can be installed from CRAN or GitHub using the install.packages function in a code cell:

install.packages("package_name")

You can also install prerelease versions and other development packages from GitHub using the devtools library:

options(unzip = 'internal')
library(devtools)
install_github('<user>/<repo>')

F#

Packages in F# can be installed from nuget.org by calling the Paket dependency manager from within code cells. First, load the Paket manager:

#load "Paket.fsx"

Then install packages:

Paket.Package
  [ "MathNet.Numerics"
    "MathNet.Numerics.FSharp"
  ]

Then load the Paket generator:

#load "Paket.Generated.Refs.fsx"

Open the library:

open MathNet.Numerics

Next steps