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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
chulpanvl
Helper I
Helper I

Python script as a data source in Power BI Service

Hello!

I have created a dashboard which uses a Python script a s a data source (it makes requests to google analytics API). Python script works fine at PBI Desktop.

As far as I understood in order to refresh data in Power Bi Service on a regular basis I need to configure a On-premises data gateway (personal mode). I did that using this instructions https://docs.microsoft.com/en-us/data-integration/gateway/service-gateway-install

So first I installed and configured a standard gateway (named powerbi_python) and then a personal mode gateway. They are installed on the same machine as my pbix file and Python.

I am confused what should I do next. I want to add a new data source under this gateway but Python script isn’t on the list:

chulpanvl_0-1643382048774.png

I go to settings -> datasets and there is a message saying the gateway isn’t configured correctly and an error message Extension{"extensionDataSourceKind":"Python","extensionDataSourcePath":"Python»} unable to add to gateway. Lower is another info saying the personal gateway is not installed although I did install it. Sorry the screen is in Russian.

chulpanvl_1-1643382096149.png

What am I missing here?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Remove both gateways and then reinstall the personal gateway.  Python scripts only work with personal gateways.

View solution in original post

14 REPLIES 14
lbendlin
Super User
Super User
frustrated_user
Microsoft Employee
Microsoft Employee

Hi, were you able to add the python extension in PowerBi service? I am facing the same issue.

lbendlin
Super User
Super User

Remove both gateways and then reinstall the personal gateway.  Python scripts only work with personal gateways.

Anonymous
Not applicable

Hi , 

 

I have the same issue and already have an enterprise gateway install to talk to the server. Could I install an additional personal gateway for python to work ?

would having both cause an issue ? Pleas help 

 

vito123_0-1691566999201.png

 

You cannot use an Enterprise Gateway to run Python scripts.  Only works with Personal Gateways.

Anonymous
Not applicable

yes , but that is my problem, I need to refresh data from a server that needs an enterprise gateway ...

what should I do in this case ?

I need to refresh data from a server that needs an enterprise gateway

What do you mean ?  Do you not see that server from your work PC?

Anonymous
Not applicable

Well I am trying to publish an app and this requires scheduled refreshes at regular intervals and that is why we have the enterprise gateway installed.

Sorry I am new and if I am not making sense ... All I care about it that the app should be able to connect to a server extract data and the python code and update the visuals..

could both of this be done by personal gateway ?

yes.  The caveat is that the Personal Gateway app needs to be running and the PC it is running on needs to be switched on, at least for the times specified in the schedule.

Anonymous
Not applicable

Hi   @lbendlin  I tried using the personal gateway here and am encountering the below message for python :

Failed to update data source credentials: ADO.NET: Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 2, in <module> import os, pandas, matplotlib File "C:\Users\VISNN\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 207, in <module> _check_versions() File "C:\Users\VISNN\Anaconda3\lib\site-packages\matplotlib\__init__.py", line 192, in _check_versions from . import ft2font ImportError: DLL load failed while importing ft2font: The specified module could not be found. 

ok, what happened after you installed the ft2font module?

Anonymous
Not applicable

This is apparently to do with a version of matplotlib (https://stackoverflow.com/questions/24251102/from-matplotlib-import-ft2font-importerror-dll-load-fai...).. I uninstalled and upgraded the version of the package again but still I am facing the same issue .. I now have a personal gateway   but i keep getting the same error:

 

vito123_1-1693190510264.png

 

vito123_0-1693190486349.png

 

Hi, I'm facing the same issue. Is there a solution for that?

Anonymous
Not applicable

No Unfortunately not.. I stopped using python scripts in power BI.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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