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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Executing Python Scripts in PowerBI

I currently have anaconda installed on my machine. I have a python script written which is working perfectly in Jupyter Notebook, the next step is I want to execute this script in Power BI to import data and pre-process the data.

I have adjusted the settings in powerBI (correctly I think):

  • Python Directory is set to C:\ProgramData\Anaconda3
  • Detected Python IDEs is set to Default OS program for .PY files

Can you provide a solution for the below error. I have spent hours trying to find something, I have read that downloading Python separately and not through Anaconda is less complexed but I would like to do it throguh anaconda.

 

Error

 

Details: "ADO.NET: Python script error.

<pi>C:\PROGRAMDATA\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:\PROGRAMDATA\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:\PROGRAMDATA\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.

 

</pi>"

 

 

 

Many thanks

 

 

 

 

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

As the error code:

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

and then check if you have set it up.

https://docs.microsoft.com/en-us/power-bi/desktop-python-ide

 

This is the related document, you can view this content:

https://community.powerbi.com/t5/Desktop/Python-script-error-ImportError-DLL-load-failed-The-specified/m-p/693717

https://stackoverflow.com/questions/54063285/numpy-is-already-installed-with-anaconda-but-i-get-an-importerror-dll-load-fail

https://stackoverflow.com/questions/20201868/importerror-dll-load-failed-the-specified-module-could-not-be-found

https://www.partitionwizard.com/partitionmanager/the-specified-module-could-not-be-found.html

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.