0

In Power BI, I am trying to import a CSV-file that's stored in an AWS S3 bucket. I used the script I found here to import the data, but I keep getting this error:

Details: "ADO.NET: Python script error. <pi>C:\Users\MyName\anaconda3\envs\PowerBI\lib\site-packages\numpy\__init__.py:143: 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\MyName\anaconda3\envs\PowerBI\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. 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.7 from "C:\Users\MyName\anaconda3\envs\PowerBI\python.exe"   * The NumPy version is: "1.20.1"

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: The specified module could not be found.

</pi>"

Anyone any ideas? I already tried lots of things myself, like:

  • installing a clean Anaconda virtual environment with the required libraries
  • remove/install numpy and setuptools as described here

Unfortunately nothing works, I keep getting the same error. Does anyone know what to do? Can it be that the Python and numpy version are not compatible? If yes, how can I find out what versions I should use that are compatible (I tried figuring this out but could not find any information)?

PunchBird
  • 89
  • 9

2 Answers2

0

The NumPy version is: "1.20.1"

Currently the service supports NumPy 1.18.4.

Make sure all your modules, and version of python match the docs located here: https://learn.microsoft.com/en-us/power-bi/connect-data/service-python-packages-support

ninMonkey
  • 7,211
  • 8
  • 37
  • 66
  • thanks for your suggestion, but the link you provided refers to Power BI Service, while I am referring to Power BI Desktop (sorry for not being clear on this). In the meantime I tried the suggestions mentioned here (using Python 3.6 and launching PowerBI from the command prompt within the correct Anaconda environment) but that also gave the same error: https://stackoverflow.com/questions/54933279/using-python-script-in-power-bi-importerror-missing-required-dependencies-nu . Does anyone know a link to clear instructions on how to import data from AWS S3 with a Python script? – PunchBird Oct 18 '21 at 12:58
0

I did extensive research in the past few days and figured it out:

  • Anaconda is not a good option to use in combination with Power BI because you need to be able to open Power Bi from the command prompt (which I can't), see this acticle
  • Instead of using Anaconda I installed Python 3.8.7 locally (64-bit version) and installed the required packages
  • To avoid any conflicts between Python versions I deleted all other local Python installations (I did not delete Anaconda's Python versions)
  • Then I opened Power BI from the start menu, cleared the cache in Power BI options & settings - Data Load (see image) and then closed Power BI again.
  • Then I opened Power BI again from the start menu and ran my Python script... it worked!

Clear cache Power BI

PunchBird
  • 89
  • 9