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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

@v-shex-msft 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
Super User
Super User

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?

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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