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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
kerch007
Frequent Visitor

use Python scripts in app.powerbi.com

Hi. Please tell me Can i use python scripts in app.powerbi.com

I make report on Desktop, which use python script in vusualisation. For implementation of this script i need import pillow module. I published this report and i've got error -

' File "C:\Script\0.py", line 30, in <module> from PIL import Image, ImageDraw, ImageFont ModuleNotFoundError: No module named 'PIL'  Снимок.PNG

1 ACCEPTED SOLUTION

In my script i use python 'pillow ' module, which does not support in Power BI. It need for read custom image for background in heat map. I rewrite my scrip in R but Visual publishing with R on the web is not supported. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I try make a heatmap with custom image too, i try

embedded image,

bring image from a local host,

bring image as url 

 

and all this mathods dont have succesuly, i need to know, how i make my code run and work in powerbi service, in the desktop, the code run normally but when i post on online the code me return de follow error: 
[S-b1dc6765-d235-48d1-b060-17dd23d183ec][S-b1dc6765-d235-48d1-b060-17dd23d183ec]ModuleNotFoundError: No module named 'PIL', the same error v-danhe-msft faced

v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @kerch007 ,

Could you please check if all of your data for your python visual is imported in your pbix? If your data was generated by python itself like random, it could not support in service.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

In my script i use python 'pillow ' module, which does not support in Power BI. It need for read custom image for background in heat map. I rewrite my scrip in R but Visual publishing with R on the web is not supported. 

Anonymous
Not applicable

Hi, I too am trying to use a background image for a heatmap but using mpimg.imread and imshow.

 

It works great in desktop, but I've not had any luck in the service.

 

Has anybody managed to do this successfully?

 

Thanks.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.