Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
camer314
New Member

Trying to get Power BI Jupyter widget to work on my custom Jupyter UI

I have a custom implementation of Jupyter, that includes all the low level websocket and comms necessary to handle widgets, where the shipped widgets work fine.

 

However, I am having an issue with Power BI widget (powerbiclient) so while that widget works fine in an AzureML notebook it fails to load the module on my client. The specific error is 'powerbi-jupyter-client@3.1.1 module not found' or thereabouts.

 

I am guessing this is because I am missing a client side library needed to render QuickVisualizeModel but I can find no documentation on this requirement or find any instance of this library on npm. I can even see the source code here https://github.com/microsoft/powerbi-jupyter/tree/main/src

 

Does anybody know what I have to do to get this to work?

1 ACCEPTED SOLUTION
camer314
New Member

I will answer my own question.

Yes, you need the powerbi-jupyter-client@3.1.1 package installed locally. You also need to overload the HTMLManager class @jupyter/widgets package to provide your own loader.

 

Then it gets interesting, because package.json for powerbi-jupyter-client@3.1.1 incorrectly point to the /lib path as the source where in fact in the package its /dist

 

So, step 1, import powebi from the lib explictly:

 

import * as powerbi from 'powerbi-jupyter-client/dist/index.js';
 
Then overload the HTMLManager class to provide your own loadClass and have this if statement 
 
    if(moduleName === "powerbi-jupyter-client") {

      return new Promise(function (resolve, reject) {
        if (powerbi) {
          if (powerbi[className]) {
            resolve(powerbi[className]);
          } else {
            reject(new Error(`Class ${className} not found in powerbi module`));
          }
        } else {
          reject(new Error("Failed to load powerbi module"));
        }        
      });
    }
 

View solution in original post

3 REPLIES 3
camer314
New Member

I will answer my own question.

Yes, you need the powerbi-jupyter-client@3.1.1 package installed locally. You also need to overload the HTMLManager class @jupyter/widgets package to provide your own loader.

 

Then it gets interesting, because package.json for powerbi-jupyter-client@3.1.1 incorrectly point to the /lib path as the source where in fact in the package its /dist

 

So, step 1, import powebi from the lib explictly:

 

import * as powerbi from 'powerbi-jupyter-client/dist/index.js';
 
Then overload the HTMLManager class to provide your own loadClass and have this if statement 
 
    if(moduleName === "powerbi-jupyter-client") {

      return new Promise(function (resolve, reject) {
        if (powerbi) {
          if (powerbi[className]) {
            resolve(powerbi[className]);
          } else {
            reject(new Error(`Class ${className} not found in powerbi module`));
          }
        } else {
          reject(new Error("Failed to load powerbi module"));
        }        
      });
    }
 
v-venuppu
Community Support
Community Support

Hi @camer314 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Regards,

Rama U.

v-venuppu
Community Support
Community Support

Hi @camer314 ,

Thank you for reaching out to Microsoft Fabric Community.

Here are some general steps that might help to reslove the issue.

  • The Power BI widget might require NodeJS to be installed on your system. You can download and install it from https://nodejs.org/en/.
  • Make sure you have ipywidgets installed. You can do this using pip like below:
    pip install ipywidgets
  • Enable the necessary Jupyter extensions for widgets like below:
    jupyter nbextension enable --py widgetsnbextension
    jupyter labextension install @jupyter-widgets/jupyterlab-manager
  • Try installing the Power BI Jupyter client explicitly:
    jupyter labextension install powerbi-jupyter-client

Here are some additional insights that might help:

  • There might be compatibility issues between the Jupyter Lab version and the Power BI widget. Ensure that the versions are compatible.
  • The error "Error displaying widget: model not found" is common for widgets that are not installed correctly. Ensure that all dependencies are installed and enabled.

Follow these detailed steps to ensure everything is set up correctly:

  • Install NodeJS.
  • Install ipywidgets.
  • Enable Jupyter extensions.
  • Install the Power BI Jupyter client.

For more detailed instructions and troubleshooting, you can refer to below documentations.

PowerBI and Jupyter can bring together the strengths of both tools

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks & Regards,

Rama U.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.