interactive icon indicating copy to clipboard operation
interactive copied to clipboard

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

Open R0315 opened this issue 2 years ago • 12 comments

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

  • OS
    • [x] Windows 11
    • [ ] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Frontend
    • [x] Jupyter Notebook
    • [ ] Jupyter Lab
    • [ ] nteract
    • [x] Visual Studio Code
    • [ ] Visual Studio Code Insiders
    • [ ] Visual Studio
    • [ ] Other (please specify)

R0315 avatar Oct 12 '23 18:10 R0315

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

IntegerMan avatar Oct 25 '23 02:10 IntegerMan

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?

shyamnamboodiripad avatar Oct 25 '23 02:10 shyamnamboodiripad

@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 avatar Oct 25 '23 03:10 IntegerMan

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 avatar Oct 25 '23 04:10 IntegerMan

@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.

IntegerMan avatar Nov 23 '23 05:11 IntegerMan

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.

shyamnamboodiripad avatar Nov 23 '23 05:11 shyamnamboodiripad

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

colombod avatar Nov 23 '23 07:11 colombod

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.

IntegerMan avatar Nov 23 '23 07:11 IntegerMan

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

colombod avatar Nov 23 '23 07:11 colombod

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

colombod avatar Nov 23 '23 09:11 colombod

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

colombod avatar Nov 23 '23 14:11 colombod

Will do. Thanks @colombod!

IntegerMan avatar Nov 23 '23 15:11 IntegerMan