Home > Software design >  Error when trying to run a Python script in Power BI
Error when trying to run a Python script in Power BI

Time:01-29

I keep getting the below error when trying to run python script in power BI. I have tried uninstalling and re-installing all numpy , pandas but to no avail.

Please i would appreciate some assistance to get this running

DataSource.Error: ADO.NET: Python script error.
<pi>C:\Users\User\anaconda3\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 "C:\Users\User\PythonScriptWrapper_6bb79068-43bc-4932-896d-bb3c9e1e2a45\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(

I have tried uninstalling and re-installing all numpy , pandas but to no avail.

CodePudding user response:

Here you go, my man: This error message suggests that there is a problem with the installation of the numpy and pandas packages. The warning message "mkl-service package failed to import" indicates that the Intel MKL library, which is used by numpy and pandas for improved performance, is not properly installed.

Solution 1: try is to install the mkl-service package, as suggested in the error message. You can do this by running the command "pip install mkl-service" in your command prompt or terminal.

Solution 2: to try is to check that your python environment is using the correct version of numpy and pandas. You can check the version of the package by running "pip show numpy" or "pip show pandas" in your command prompt or terminal. Then you can try uninstalling the package and reinstalling the correct version that is compatible with your python environment.

Tip 1: You can also try to update your python version or using other python environment( eg: virtual environment) and check the compatibility of the package with the version of python you are using.

Tip 2: Check that the python version you are using in Power BI is the same version of python you are installing the packages to.

CodePudding user response:

Since you are using the Anaconda Python distribution you are probably pretty aware that

you have to ACTIVATE conda,

before you can run PBIDesktop.exe. This especially true if you want to include the C-libraries like the ones required for numpy.

Simple as that.

  • Related