Jupyter

Microsoft.dotnet-interactive is not compatible with netcoreapp3.1

Today I was writing an example PowerShell script in Jupyter Notebook that used a module that required PowerShell 7.1.x. It wasn’t working and was complaining about not meeting the minimum requirements. I checked to see what the current version of PowerShell was in my .NET Interactive environment (required for PowerShell in Jupyter) and was indeed not at the minimum required for the module. It was PowerShell 7.0.3.

When attempting to update .NET Interactive which I figured would be required to get the latest version of PowerShell, I was returned the error Microsoft.dotnet-interactive is not compatible with netcoreapp3.1.

This posts details getting my environment updated to allow me to run PowerShell 7.1.x in Jupyter Notebook.

Error – Microsoft.dotnet-interactive is not compatible with netcoreapp3.1

Error message Microsoft.dotnet-interactive is not compatible with netcoreapp3.1 is returned when using dotnet tool to update Microsoft.dotnet-interactive.

dotnet tool update -g Microsoft.dotnet-interactive

Inspecting .NET SDK Versions

It was time to have a look at the versions of the .NET SDK’s I had installed in my environment. Running dotnet –info showed that I had versions 2.2.x, 3.1.201 and 3.1.301.

The error above did state that net5.0 (.NETCoreApp,Version=5.0) was required for the latest (1.0.221505) version of Microsoft.dotnet-interactive. That is because PowerShell 7.1 is built upon .NET 5.

Updating .NET SDK / Installing .NET 5 SDK

I headed over to dotnet.microsoft.com and downloaded the x64 bit version of the .NET SDK 5.0.

And I installed the .NET 5 SDK.

After installation I checked the versions installed again using dotnet –info. It showed that I now had version 5.0.202 in addition to the versions I previously had.

Updating Microsoft.dotnet-interactive for PowerShell 7.1.x

Re-running the update for .NET Interactive this time was successful. No more Microsoft.dotnet-interactive is not compatible with netcoreapp3.1 error message.

dotnet tool update -g Microsoft.dotnet-interactive 

PowerShell 7.1.x in Jupyter Notebook

Going back and starting Jupyter Notebook and checking the version of PowerShell I could see that it was now up to date with PowerShell 7.1.3.

Summary

If you have been running Jupyter Notebook for some time and have being using PowerShell 6.x or 7.0.x you will need to install the .NET 5.0 SDK and update .NET Interactive to the latest release and then PowerShell 7.1.x will be available.

Darren Robinson

Bespoke learnings from a Microsoft Identity and Access Management Architect using lots of Microsoft Identity Manager, Azure Active Directory, PowerShell, SailPoint IdentityNow and Lithnet products and services.

View Comments

Recent Posts

Visualising your IP Address using PowerShell and AI

A few weeks back the Microsoft AI Tour was in Sydney Australia. There was a…

3 weeks ago

Where the heck is the PowerShell Module loading from?

If you're anything like me you always have PowerShell open, and often both PowerShell and…

4 months ago

Express Verified ID Setup

Decentralised Identity is a technology I'm passionate about and have written many posts and tools…

5 months ago

Orchestrating 1Password with PowerShell

Over two years ago I authored a PowerShell Module that enabled the automation of 1Password.…

8 months ago

Entra ID Tenant ID & Custom Domains PowerShell Module

Buried in my PowerShell Snippets Vol 4 post from 2021 is the PowerShell script and…

8 months ago

Windows Subsystem for Linux instance has terminated

Short post on how to recovery from "The Windows Subsystem for Linux instance has terminated"…

9 months ago

This website uses cookies.