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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ceeva
New Member

Running Python scripts in power BI with anaconda environment

Hi All,

 

I am new to Power BI and I have been trying to run a python script to load data. However, when I run a simple script, I am getting the following error:

 

Code:

ceeva_0-1672857658009.png

Error: 

 

 

Details: "ADO.NET: Python script error.
<pi>C:\Users\sdingari\Anaconda3\envs\mybi\lib\site-packages\numpy\__init__.py:148: 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\sdingari\Anaconda3\envs\mybi\lib\site-packages\matplotlib\__init__.py", line 109, in <module>
    from . import _api, _version, cbook, docstring, rcsetup
  File "C:\Users\sdingari\Anaconda3\envs\mybi\lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\sdingari\Anaconda3\envs\mybi\lib\site-packages\matplotlib\colors.py", line 51, in <module>
    from PIL import Image
  File "C:\Users\sdingari\Anaconda3\envs\mybi\lib\site-packages\PIL\Image.py", line 89, in <module>
    from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified module could not be found.
</pi>"

 

 

I created an environment in anaconda and I am using that environment as my home directory in PowerBI.

ceeva_1-1672857741578.png

I have mkl-service and pillow installed in my anaconda enviroment, now sure why there is an error.

Any help is greatly appreciated.

 

Thanks a lot.

 

2 REPLIES 2
ceeva
New Member

Hi @Anonymous ,
Thanks a lot for the response.
I was able to fix the issue by following these steps:

- Open anaconda prompt and activate the environment that is being used

- Start PowerBI from the anaconda environment by typing "Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe" (This is the path where my PowerBI app is)

- Once PowerBI app opens, check the python paths and run the script

It created the datasets in the script without any errors. 

Anonymous
Not applicable

Hi @ceeva ,

So far, not all python packages are supported by power bi.,"mkl-service" python  package is not supported by power bi.

 If you would like to request support of a Python package not found in below list, please submit your request to Power BI Ideas

vbinbinyumsft_0-1672899018074.png

For more details, you can read related document: Learn which Python packages are supported - Power BI | Microsoft Learn

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

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 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.