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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Getting error while connecting to python

Can someone help me what could be causing issue while running python script in power BI Desktop ? 

i have installed the latest version of Power BI Desktop.

 

Here is the error message :

DataSource.Error: ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonUnexpectedException

11 REPLIES 11
apods1979
Helper I
Helper I

C:\Users\YouUSER\Anaconda3
C:\Users\YouUSER\Anaconda3\Library\mingw-w64\bin
C:\Users\YouUSER\Anaconda3\Scripts
C:\Users\YouUSER\Anaconda3\Library\bin

Anonymous
Not applicable

HI @Anonymous,

How your script coding? General get data with some processing steps or nested multiple get data and processing steps? Can you please share some sample formulas to test?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@Anonymous I still getting the issue .. I tried configuring again. 

Here are details :

Script I am runningin powerBI, it is working fine in VS code editor :

import pandas as pd
data = [['Alex',10],['Bob',12],['Clarke',13]]
df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)
print (df)
 
Error it is throwing :
 
DataSource.Error: ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonUnexpectedException
 
I am just simply adding python script and running it. Python is installed on my machine in C drive and same path is mentioned in the power BI. 
Let me know if I am missing anything. Note : I am not doing any complex script execution, its simple dataframe out mention above.. I am using python 3.8.2  ..  
Pragati11
Super User
Super User

Hi @Anonymous ,

 

From looking at the error you are geeting, it looks like, there is some issue with the Python script that you have written.

Can you check it or may be share it here?

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Greg_Deckler @Pragati11 

 

Thank you for quick response. 

I am just following the power BI article and testing basic python script. I tested the script on my IDE and it is working fine but when I try to run via power BI, it is throwing error. 

I took the python script from this link https://docs.microsoft.com/en-us/power-bi/desktop-python-scripts

 

import pandas as pd

data = [['Alex',10],['Bob',12],['Clarke',13]]

df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)

print (df)

HI @Anonymous ,

 

Just wanted to check what version of Python are you using? Did you directly install a Python version to your machine or through Anaconda?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

@Pragati11 Installed python directly and version is 3.8.2

HI @Anonymous ,

 

I tired to replicate the same at my end and it works perfectly fine. See below:

pythonTest.png

I did the following:

  1. Followed the steps here- https://docs.microsoft.com/en-us/power-bi/desktop-python-scripts
  2. Python directory path in Power BI is same to the path I have on my machine.
  3. Ran the script in Python on my machine first. It worked and then tried in Power BI which also worked as shown above.
  4. Python version I have is Python3.6.5

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

@Pragati11 That is strange, it is not working on my machine.

I have below python script configuraiton on Power BI. Python installed in c drive Python folder, it is correct configuration ? or it required different configuraiton ?

 

Hi @Anonymous ,

 

Whatever is the path for Python on your machine, the same should be in Power BI. That's what I have at my end.

If your python path is "C:/Python" then in POwer BI under File --> Option & Settings --> Options --> Python Scripting same "C:/Python" path should be there.

If it still doesn't work, try from scratch again in Power BI.

 

Also, is there any other Python folder under this path "C:/Python" like "C:/Python/Python36". If yes then your correct path should be "C:/Python/Python36"

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Community Champion
Community Champion

Well, typical troubleshooting is:

  1. Is Python installed?
  2. Can you run a Python script in your Python IDE?
  3. Can you run the script you are trying to use in Power BI in your Python IDE?
  4. Is your Power BI Python configuration pointing to the right place? File | Options and settings | Options
  5. Are all of your Python modules installed in the right locations?


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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