Error running python script into Power BI: Unable to import required dependencies: Numpy

Viewed 513

I recently installed Anaconda into my system (Win10) and created a virtual environment in conda to install several packages and dependencies with the intention to connect it to Power BI, so I can run Python scripts.

In that virtual environment, I installed Python 3.6 and many other dependencies. After running the script several times, I also installed conda install -c intel mkl-service however, it seems that there is an issue with Numpy. I checked Numpy version 1.19.1 and it says that Python 3.6 or higher is required, which is what I have.

It is interesting that everything works fine at Jupyter (using the same environment kernel), but no in Power BI

Not sure how to proceed, maybe uninstalling Numpy via pip and re-installing it via conda?

Any advice will be helpful

Here is the error:


Please note and check the following:
  * The Python version is: Python3.6 from "C:\Users\creyes\Anaconda3\envs\myenv\python.exe"
  * The NumPy version is: "1.19.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: No se puede encontrar el módulo especificado.
Details:
    DataSourceKind=Python
    DataSourcePath=Python
    Message=Python script error.
C:\Users\creyes\Anaconda3\envs\myenv\lib\site-packages\numpy\__init__.py:138: 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\creyes\Anaconda3\envs\myenv\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 NumP...
    ErrorCode=-2147467259
    ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException
0 Answers
Related