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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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

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
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.