'ADO.NET error trying to run Python Script in PowerBI

I have Anaconda which runs this simple script fine:

import pandas as pd
data = [['Alex',10],['Bob',12],['Clarke',13]]
df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)
print (df)

It runs from both Anaconda promprt and normal command prompt, as the path is set to include the Anaconda3 folder.

Trying to use PowerBI, following the Microsoft example, I get:

Details: "ADO.NET: Python script error. Traceback (most recent call last): File "PythonScriptWrapper.PY", line 2, in import os, pandas, matplotlib File "C:\ProgramData\Anaconda3\lib\site-packages\pandas__init__.py", line 19, in "Missing required dependencies {0}".format(missing_dependencies)) ImportError: Missing required dependencies ['numpy']



Solution 1:[1]

I had a very similar error (my missing dependency was xlrd). To get my python script to run in PowerBI I had to install the missing dependency using pip:

C:\>pip install xlrd

My PowerBI points to my Python distribution installed in C:\Python (yours most likely points to Anaconda).

I would try installing numpy through Anaconda and then re-run your Python Script in Power BI.

Solution 2:[2]

1. Add Anaconda to System Environment Variable Path list:

C:\ProgramData\Anaconda3
C:\ProgramData\Anaconda3\Scripts
C:\ProgramData\Anaconda3\Library\bin

Environment variable should be above other python installs

2. Updated/Reinstall PowerBI if the erron still persists.

Solution 3:[3]

The short answer is that the solution is launching the Power BI Desktop executable from the Anaconda Prompt after activating the environment in which you want to run the Python script.

The long one is described in this blog post.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Grant Shannon
Solution 2
Solution 3 lucazav