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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Error when trying to execute python script

Hi there, I'm getting error when executing python script.

 

Things I've tried from similar issue tickets from support. I've changed data source permissions. I've upgraded python via conda forge.

 

I run latest version of Power BI desktop and Anaconda as python environment

 

DataSource.Error: ADO.NET: Python script error.
C:\Users\user\Anaconda3\lib\site-packages\numpy\__init__.py:140: 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 "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
File "C:\Users\user\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:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

* The Python version is: Python3.8 from "C:\Users\user\Anaconda3\python.exe"
* The NumPy version is: "1.18.5"

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.


Details:
DataSourceKind=Python
DataSourcePath=Python
Message=Python script error.
C:\Users\gkereselidze\Anaconda3\lib\site-packages\numpy\__init__.py:140: 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 "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
File "C:\Users\user\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 trouble...
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Unfortunately It was not worked. I was getting errors when trying to uninstal packages.

 

But, I found soulution here if anyone experiencing same issue  - https://medium.com/@pbabbott/how-to-connect-power-bi-and-python-on-windows-10-b131a36f4b44

 

So, the first thing you’ll want to do in this custom terminal is establish an environment with python 3.6 which can be done with this command:

conda create --name std_env python=3.6

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Please follow below steps, it might help you

 

  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
amitchandak
Super User
Super User

@Anonymous , As far I remember. I faced this. and conda install will not work. You need to use pip install even with the  anaconda.

 

uninstall first if needed

pip install --upgrade --force-reinstall numpy

pip install --upgrade --force-reinstall pandas

pip install --upgrade --force-reinstall matplotlib

pip install -c conda-forge mkl-service

conda activate

 

 

refer to my video and its description for related issues and command : https://www.youtube.com/watch?v=5D0BkNsu5CM

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey!

Thank you so much for your answer. However, I believe the last line of code should rather be:

 

conda install -c conda-forge mkl-service 

 

pip install -c conda-forge mkl-service

gives an error message at least if you install it with Anaconda Prompt

Anonymous
Not applicable

Unfortunately It was not worked. I was getting errors when trying to uninstal packages.

 

But, I found soulution here if anyone experiencing same issue  - https://medium.com/@pbabbott/how-to-connect-power-bi-and-python-on-windows-10-b131a36f4b44

 

So, the first thing you’ll want to do in this custom terminal is establish an environment with python 3.6 which can be done with this command:

conda create --name std_env python=3.6

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors