Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Waa302
New Member

Error when connecting python to PBI

 
Hi, Despite the fact that I do have Python installed when I'm trying to connect it to PBI I get an error message:
 
Unable to connect:

Details: "ADO.NET: Python script error.
Traceback (most recent call last):
  File "PythonScriptWrapper.PY", line 2, in <module>
    import os, pandas, matplotlib.pyplot
  File "C:\USERS\WAA302\APPDATA\LOCAL\CONTINUUM\ANACONDA3_5.3.1\lib\site-packages\pandas\__init__.py", line 19, in <module>
    "Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
"

Can anyone help please?
1 ACCEPTED SOLUTION

As I found out yestreday the issue was due to Power Bi not supporting Python 3.7. i had to created new env for py36 and it worked form there!

 

Thank you

View solution in original post

17 REPLIES 17
pkoetzing
Advocate III
Advocate III

With the November 2019 release of PBIDesktop I see no issues running Python 3.7 from the Anaconda stack. All that is needed is to start PBIDesktop from within an activated conda environment and have the Python home directory configured in the Python scripting options.

 

From the Anaconda Prompt run:

(base) C:> "Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

 

Hi, I have the same problem and actually this didnt work, i've got the following error

GianlucaM_0-1664807038893.png

Can anyone help?

 

Thanks

It woked doing this way . Thank you very much

I was getting the same problem, and the solution from @pkoetzing  worked.

 

Thank you so much!!

@pkoetzing  I don't appear to have this option. I'm running Windows 10 Pro, and I just installed PBI Desktop as an App, so it doesn't seem to show up in any of my folders as a file. Is there a way to get around this regardless?

Windows 10 Apps are stored in C:\Program Files\WindowsApps, so you can find the executable in something like

 

C:\Program Files\WindowsApps\Microsoft.MicrosoftPowerBIDesktop_2.75.5653.0_x64__8wekyb3d8bbwe\bin\PBIDesktop.exe

However, the WindowsApps folder is both hidden and protected, but with admin rights you can take over ownership like described e.g. in this article: https://www.maketecheasier.com/access-windowsapps-folder-windows-10/.

@pkoetzing 

Thank you so much!

 

I simply uninstalled the PBI that was installed through the Microsoft Store, and then downloaded the other version that gets installed in the Program File folder.

 

It would seem that, exactly as you said, launching PBI via anaconda prompt finally allows my Python to run in PBI! I'm ecstatic!

 

My only question is why this doesn't work when launching PBI normally. This is what I can't place a cause for - because it looks like both settings (with regard to Python script options) is the same regardless of which way i open it. 

Greg_Deckler
Super User
Super User

From what I am seeing in your error message, it looks like you are missing a Python package "numpy".


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Which doesn't make sense as I have it installed :

 

Capture.PNG

is you PATH environment match what you have in your options?

to check your environement:

1) Open the Python Shell and

2) type:

import sys
print(sys.exec_prefix)

 

Yes it is the same :

 

Capture.PNGCapture.PNG

Hi @Waa302,

 

Since you have two different release of Python, I'm afraid the Numpy is in Python37 rather than in the Anaconda. Please check out. You can do it like below.

pip list -v

Error-when-connecting-python-to-PBI

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

As I found out yestreday the issue was due to Power Bi not supporting Python 3.7. i had to created new env for py36 and it worked form there!

 

Thank you

How can you create an environment in python 3.6? what needs to change in order to do this?

Anonymous
Not applicable

Hi,

 

I have installed Python3.6 together with pandas, numpy in the same folder but this error below still persist.

What else could have caused this error, please advise.

 

 

DataSource.Error: ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
ModuleNotFoundError: No module named 'matplotlib'

Details:
DataSourceKind=Python
DataSourcePath=Python
Message=Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
ModuleNotFoundError: No module named 'matplotlib'

ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException

 

 

 

Anonymous
Not applicable

hi, is actually Power BI now supporting  Pyhton 3.7 I am having the sam error.

Details: "ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 4, in <module>
import matplotlib.pyplot
File "C:\USERS\SARMIENTOF\APPDATA\ROAMING\CONTINUUM\ANACONDA3\lib\site-packages\matplotlib\pyplot.py", line 32, in <module>
import matplotlib.colorbar
File "C:\USERS\SARMIENTOF\APPDATA\ROAMING\CONTINUUM\ANACONDA3\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.contour as contour
File "C:\USERS\SARMIENTOF\APPDATA\ROAMING\CONTINUUM\ANACONDA3\lib\site-packages\matplotlib\contour.py", line 18, in <module>
import matplotlib.font_manager as font_manager
File "C:\USERS\SARMIENTOF\APPDATA\ROAMING\CONTINUUM\ANACONDA3\lib\site-packages\matplotlib\font_manager.py", line 48, in <module>
from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: The specified module could not be found.
"

Hi, did we find solution for htis?

I am having similar error. And how do we create environment for 3.6 and link it to powerbi?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.