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

Error 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

 
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

According to the error message

>> UserWarning: mkl-service package failed to import

>>"Failed to update data source credentials: ADO.NET: Python script error. "  " Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.",

 

The refresh failure is due to a Python script error, please install mkl-service package according to the prompt, and then reinstall NumPy according to this link

vxiaotang_0-1655285151671.png

 

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

According to the error message

>> UserWarning: mkl-service package failed to import

>>"Failed to update data source credentials: ADO.NET: Python script error. "  " Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.",

 

The refresh failure is due to a Python script error, please install mkl-service package according to the prompt, and then reinstall NumPy according to this link

vxiaotang_0-1655285151671.png

 

 

Best Regards,

Community Support Team _Tang

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

lbendlin
Super User
Super User

Please confirm that you have a personal gateway installed.

 

Confirm your package is supported Learn which Python packages are supported - Power BI | Microsoft Docs

Anonymous
Not applicable

I can confirm that the personal mode gateway is installed as shown below. 

 

Regarding packages, below are the ones I use in the scripts. When I look at the packages supported in Power BI part in your shared link, it does not include JSON. Is that the issue? But the script can be run in Power BI Desktop. 

 

Packages Used in my Script

import pandas as pd
import json
import requests
import datetime

Becky_L_0-1651715626991.png

 

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.