Vscode-jupyter: cant use fairlearn in visual studio code

Created on 17 Jun 2020  路  15Comments  路  Source: microsoft/vscode-jupyter

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

1.

Actual behavior

Expected behavior

Your Jupyter and/or Python environment

_Please provide as much info as you readily know_

  • Jupyter server running: Local | Remote | N/A
  • Extension version: 20YY.MM.#####-xxx
  • VS Code version: #.##
  • Setting python.jediEnabled: true | false
  • Setting python.languageServer: Jedi | Microsoft | None
  • Python and/or Anaconda version: #.#.#
  • OS: Windows | Mac | Linux (distro):
  • Virtual environment: conda | venv | virtualenv | N/A | ...

Developer Tools Console Output

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

bug

All 15 comments

Do you have any more information? It seems to work for me:

image

What output do you get when using it?

finally the HTML page is displayed for me too, for some reasons it took a long time before its displayed.
I still got a popup with the error message asking me to report the issue
image

I'm using Python 3.8.3
I reinstalled it and reinstall the package.
I have not found a full installation procedure. so I'm not sure what is required / missing / out of date.

well... at least I have it now.

Yeah that message could be better. It means the fairlearn-widget does not have a bundle on the two CDNs we use for downloading its javascript.

In jupyter, when a widget loads, jupyter loads it from an nbextensions directory. However this javascript can have jupyter dependencies embedded in it (and hence won't load for us). Most widgets provide a packaged version of their javascript on either http://unpkg.com or http://jsdelivr.net.

That message you have there pops up when we can't find the packaged javascript and so we try to load the js directly from where Jupyter loads it. Sometimes that doesn't work.

is there a way to manually download the missing stuff?
now again I'm seeing nothing in my own python code, but the fairlearn samples are working fine (except the popup)

Unfortunately fairlearn is not packaging their widget in such a way that it can be hosted outside of jupyter. That's the reason the popup appears. To fix that, they would have to publish their javascript outside of just their jupyter extension (like beakerx, ipyvolume, ipyleaflet, etc do).

That may not be the problem though. Can you include a piece of code that fails and I can try it here?

here a model and some data
sql_query2.zip
the dashboard is not displayed there.

I got the code from a fairlearn working sample

I can't get your model to load. Looks like we have different versions of scikit-learn:

ImportError: cannot import name '_check_sample_weight' from 'sklearn.utils.validation' (C:\Users\rchiodo.REDMOND\AppData\Local\Continuum\miniconda3\envs\jupyter\lib\site-packages\sklearn\utils\validation.py)

What version of scikit-learn was used to generate the model?

here my version:
scikit-learn 0.23.1

That's the same version I have. Unless sklearn.utils is a different package.

Okay restarting the jupyter server and now I can load and repro your problem.

Your sample isn't working because fairlearn is crashing. See my console output:

console-1592599888072.log

You can get to that if you run 'Developer: Open Webview Developer Tools' from the command palette.

So it looks like a bug in fairlearn (or some piece of jupyter they rely on that causes the crash).

I added a bug to fairlearn. Hopefully somebody that works on fairlearn will know what to do.
https://github.com/fairlearn/fairlearn/issues/501

thanks for your great help and quick feedback.

Was this page helpful?
0 / 5 - 0 ratings