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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tomi5
Helper II
Helper II

How are python scripts executed when refreshing on the service?

Hi,

 

I have a table in power bi that is imported into power bi, then I run a python script on this that performs sentiment analysis and adds a row to the table saying if the comment is positive, negative, or neutral.

 

To get this to work I have python installed on my local machine and all the relevant libraries for python that allow this to work.

 

When I go to publish this report to the service and set an automated refresh will it know how to execute the python script when it refreshes? I am just wondering how it can execute this in the service, does it see which libraries are dependencies for the script then install them on the service (along with installing python itself?) somehow?

 

Or am I completely not understanding how python scripts are executed on the service.

 

Thanks

1 REPLY 1
ibarrau
Super User
Super User

Hi. I'm not sure if there are deep specifications about this, but let me share my thoughts on this. The main reason why python scripts must have an on premise data gateway installed with Personal Mode is the answer. You must set up the environment on the VM that contains the gateway. Installing python and the libraries there will help the engine run the PowerQuery M script containing Python (unless you have built the pbi desktop reports on the same machine of the gateway, then you already have everything) when the refresh is triggered at Service. 

I hope that make sense


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.