Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 3.09 KB

NotebookswithJupyter.md

File metadata and controls

73 lines (48 loc) · 3.09 KB

Using .NET notebooks with Jupyter Notebook / JupyterLab

There are two ways to use .NET notebooks on your machine with .NET Interactive:

  • Install .NET Interactive as a Jupyter kernel for use with Jupyter Notebook, JupyterLab, nteract, Azure Data Studio, and others.

or

Both of these methods can read and write .ipynb files, which are fully portable between them.

Installing .NET Interactive as a Jupyter kernel

First, make sure you have the following installed:

  • The .NET 5 SDK.

  • Jupyter. An easy way to install Jupyter is through Anaconda.

  • Open the Anaconda Prompt (Windows) or Terminal (macOS) and verify that Jupyter is installed and present on the path:

> jupyter kernelspec list
  python3        ~\jupyter\kernels\python3
  • Next, in an ordinary console, install the dotnet interactive global tool:
> dotnet tool install -g --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive

Note: The Azure feed is where the most up-to-date version will be published:

https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

Older, more stable versions will be made available on NuGet.org.

  • Switch back to your Anaconda prompt and install the .NET kernel by running the following:
> dotnet interactive jupyter install
Installing using jupyter kernelspec module.
Installed ".NET (C#)" kernel.
Installing using jupyter kernelspec module.
Installed ".NET (F#)" kernel.
Installing using jupyter kernelspec module.
Installed ".NET (PowerShell)" kernel.
  • You can verify the installation by running the following again in the Anaconda Prompt:
> jupyter kernelspec list
  .net-csharp        ~\jupyter\kernels\.net-csharp
  .net-fsharp        ~\jupyter\kernels\.net-fsharp
  .net-powershell    ~\jupyter\kernels\.net-powershell
  python3            ~\jupyter\kernels\python3

Running the .NET Interactive Jupyter kernel

To launch Jupyter, you can run either jupyter lab or jupyter notebook from your Anaconda Prompt, or you can launch Jupyter using the Anaconda Navigator.

Once Jupyter has launched in your browser, you have the option to create notebooks using C#, F#, or PowerShell.

For more information on the .NET notebook experience, please check out our samples and documentation on Binder or in this repo under docs and samples.

Once you've created a .NET notebook, you might want to share it with others. In the next document, you will learn how to share your .NET notebook with others using Binder.