dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.88k stars 382 forks source link

Failed to load kernel extension "DataFrameKernelExtension" from assembly ..\\.nuget\packages\microsoft.data.analysis\0.20.1\interactive-extensions\dotnet\Microsoft.Data.Analysis.Interactive.dll #3256

Open R0315 opened 11 months ago

R0315 commented 11 months ago

Describe the bug

The line "#r "nuget: Microsoft.Data.Analysis" causes error that DataFrameKernelExtension failed to load, saying that the method "Void Microsoft.DotNet.Interactive.Commands.SubmitCode..ctor" was not found.

This error will happen every time I initially run the cell, but then a second run of the cell seems to work just fine.

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ): 1.0.451105+4f6017e3674e56fe8b5786ce5b0b846d63d9d2f6

IntegerMan commented 11 months ago

I can replicate this. I'm not sure when the issue started. The DataFrame's visualizer does work in the subsequent cells, so it appears to not be a catastrophic failure, but it's not going to be a good experience for most users.

image
shyamnamboodiripad commented 11 months ago

Looks like there is a newer (albeit preview) version of the Microsoft.Data.Analysis package where this should be fixed - 0.21.0-preview.23511.1

Could you try if referencing this version explicitly fixes the issue?

IntegerMan commented 11 months ago

@shyamnamboodiripad I can confirm that this does run without error after restarting the kernel and using #r "nuget:Microsoft.Data.Analysis,0.21.0-preview.23511.1"

image
IntegerMan commented 11 months ago

Though interestingly, I do later get a confusing error trying to save the DataFrame to a CSV, which may be due to preview packages; I'm not sure.

image
IntegerMan commented 10 months ago

@shyamnamboodiripad do you or anyone else on the team have any updates on this? The compatibility issue mentioned above is still a blocker in Polyglot Notebooks as you cannot use DataFrame functions due to mismatches. I'm sure running DataFrame.SaveCsv is just one of the things you can't do with the current bugged version. I'd even settle for a temporary workaround as I'm trying to validate the code for a book on using .NET and Polyglot Notebooks for data analysis and ML tasks.

shyamnamboodiripad commented 10 months ago

Tagging @colombod and @jonsequitur who would know more about this extension and may be able to provide a better update for the issue you are running into.

colombod commented 10 months ago

Are you loading any other nuget package beside the one I see reported in the issue?

IntegerMan commented 10 months ago

Are you loading any other nuget package beside the one I see reported in the issue?

@colombod sure enough that was it - I had included the following references for data viz. Removing them removes the Type resolution issue:

#r "nuget:XPlot.Plotly"
#r "nuget:XPlot.Plotly.Interactive"

So, this is great because it lets me have a few data checkpoints in my processes, but ultimately I want to have a single notebook that can load data, wrangle it, perform statistical analysis and data visualization on it, then train / test split that data and run ML .NET experiments (planning AutoML regression and classification), evaluate the model, save it, and use it to make predictions. Looking to show Polyglot and DataFrame as a key part of a .NET data science workflow with TBD data viz libraries in the middle and ML .NET for model training, evaluation, and deployment.

Ideally we get all these things compatible, but in the short term I can work around potholes by using several notebooks and CSV files to effectively hand off checkpoints of the data.

colombod commented 10 months ago

We can PR the package version update (was released just before ignite) so it is xplot with old references?

colombod commented 10 months ago

Xplot has not been updated in months. Is it still maintained? I tend to use Plotly directly

colombod commented 10 months ago

Having issues with proper xplot upgrade, I suggest to start migrating over to plotly package

IntegerMan commented 10 months ago

Will do. Thanks @colombod!