Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Solved! Go to Solution.
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
Please follow below steps, it might help you
@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
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
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
88 | |
83 | |
64 | |
49 |
User | Count |
---|---|
127 | |
108 | |
87 | |
70 | |
66 |