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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

12 REPLIES 12
lbendlin
Super User
Super User

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.

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.

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?

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.

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?

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

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors