pooja yadav
pooja yadav

Reputation: 19

Error in Power BI while importing pandas library in python scrip

Below are the mentioned error while importing pandas library in Power BI in python script.

Details: "ADO.NET: Python script error.
C:\USERS\YADAVP\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\YADAVP\ANACONDA3\lib\site-packages\pandas\__init__.py", line 17, in <module>
    "Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
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.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "C:\USERS\YADAVP\ANACONDA3\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.18.1" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

What is the resolution to sort this kind of error in Power BI?

Upvotes: 1

Views: 2088

Answers (2)

Odarnoc
Odarnoc

Reputation: 29

Forget Anaconda and use WinPython. I tried Anaconda for days with all the workarounds available in StackOverflow and other forums, and they took me nowhere. Then I tried WinPython, and it worked immediately. Of course, you will need to change the PowerBI options accordingly.

  1. To install WinPython: https://github.com/winpython/winpython
  2. To change the detected Python home directory: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts#enable-python-scripting

If you consider my answer, you won't need to downgrade Python, PBI, or anything else.

Upvotes: 0

Palm Patho
Palm Patho

Reputation: 49

I had the same error. Unfortunately, PowerBI wont work with Jupyter Notebook Python. So you have to install a "normal" Python: https://www.python.org/downloads/

And configure the Python you want to use in PowerBI and install your needed Python libraries via pip

Edit: Please use Python 3.8 because 3.9 doesnt support NumPy for now

Upvotes: -1

Related Questions