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
Anonymous
Not applicable

Errow when scheduling refresh for Python script in Power BI

Hi all,

 

Hope to get some advice with Power BI schedule refershing Python script.

 

I can run the Python script in Power BI successfully. I am using Anaconda environment and I do have issue before when running it directly in Power BI Python script. However, after following the artile, How to Get Started Using Python using Anaconda, VS Code, Power BI and SQL Server, which I find oneline, it now works. The problem now is that when I try to automate the Python script using schedule refresh Gateway connection, it pops up error again. Please see below for details. I am using personal gateway. I cannot find a solution online. Could anyone help with this? Thanks!

 

Failed to update data source credentials: ADO.NET: Python script error. C:\Users\becky.lam\Anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from . import _distributor_init Traceback (most recent call last): File "C:\Users\becky.lam\PythonScriptWrapper_a418e530-37dc-4b01-9ce1-9ef57887a15a\PythonScriptWrapper.PY", line 2, in <module> import os, pandas, matplotlib File "C:\Users\becky.lam\Anaconda3\lib\site-packages\pandas\__init__.py", line 16, in <module> raise ImportError( ImportError: Unable to import required dependencies: numpy: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: Please note and check the following: * The Python version is: Python3.9 from "C:\Users\becky.lam\Anaconda3\python.exe" * The NumPy version is: "1.20.3" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found. Hide details

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

Which version of Python your Anaconda environment is using? Try to create a new conda env with Python. 

Then pip installing relevant packages:

 

conda activate py

py -m pip install matplotlib

py -m pip install pandas

 

After finishing it, you need to point Power BI Desktop to the new env following steps :File -> Options and Settings -> Options -> Python Scripting. Then add the Path to your new Env, looks like: "C:\ProgramData\Anaconda3\envs\py".

 

Reference:

Python visualizations in Power BI Service

Configure scheduled refresh - Power BI

 

I have also found a similar post, please refer to it to see if it helps you.

ADO.NET error trying to run Python Script in PowerBI 

  • My PowerBI points to my Python distribution installed in C:\Python (yours most likely points to Anaconda).

 

If I have misunderstood your meaning, please provide a screenshot with the errors.

 

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi Polly,

 

I downloaded the latest Anaconda distribution a few days ago so I suppose I am using Python 3.9. 

 

I have created a new env called powerbi_env and have added the path to the new env as shown below. I added the pandas, matplotlib, numpy packages through the Anaconda navigator (also shown below). It could be run using Power BI desktop without issues. However, when I try to use the personal gateway to automate it, an error pops up as shown in the below first screencap. It seems the gateway cannot connect to the most new environment? Any ideas what I should do? 

Becky_L_3-1651803986154.png

 

Becky_L_2-1651803875687.png

 

Becky_L_1-1651803759733.png

 

Becky_L_0-1651803724419.png

 

Anonymous
Not applicable

Hi @Anonymous , 

Please refer to the topics to see if them help.

Python script source error- ADO.net failed to load 

  • returned the Gateway version to 3000.37.35.

Power BI python script env change worked for PowerBI Desktop but not work for app.powerbi.com 

  • adding new environment directory as path variable.

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi Polly,

 

I try the first method and download the oldest version I can find in this page 3000.101.16. But it still pops up the same error message. 

 

For adding new environment directory as path variable. Could you please describe what I should exactly do in the process? 

Anonymous
Not applicable

Hi @Anonymous ,

Step by step procedure: 

  1. Download last version of Winpython from : https://winpython.github.io/
  2. Install Winpython on C: \
  3. In Power BI Desktop, select File > Options and settings > Options > Python scripting. The Python script options page appears. 
  4. Specify the local Python installation path with the Winpython folder defined at step 2
  5. Restart Power BI

More details: Power BI Python with Anaconda missing dependency 

 

Best Regards
Community Support Team _ Polly

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

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.