cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmandavia Frequent Visitor
Frequent Visitor

python script error

Hello,

 

My python connection was working but it stopped today and keep on receiving this 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

 

How do i solve this?

7 REPLIES 7
Community Support Team
Community Support Team

Re: python script error

Hi @jmandavia,

 

Can you please provide more detail information to help us clarify your scenario?(e.g, python version, desktop version, datasource you connect)

 

According to your error message, it seems like a script error during progress. Have you double check and debug your code?

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
shuaho Frequent Visitor
Frequent Visitor

Re: python script error

I have the similar error, my python script works well outside of PowerBI, but get below error: 

 

  

We encountered an error while trying to connect. 

Details:"ADO.NETSmiley Tongueython script error.

Traceback(most recent call last):

 File "PythoScriptWrapper.PY", line 2, in <module> 

  import os, pandas, matplotlib.pyplot

  ImportError: No module name pandas

 

 

I don't have pandas in the script,  Here is my script:

 

import requests
import json

url='https://api-XXXXXX.com/api/1.0/authentication/XXXXXXXXX/login'
data='''{
"userName": "XXX",
"password": "XXX"
}
'''
headers = {
"content-Type":"application/json"
}

resp = requests.post(url, headers=headers, data=data, verify=False)
jData = json.loads(resp.content)
token = jData['accessToken']

 

 

 

 

 

VShah Frequent Visitor
Frequent Visitor

Re: python script error

Hello 

 

I am getting the same error and unable to proceed further. Is there any way to debug this issue 

 

 

jravich Occasional Visitor
Occasional Visitor

Re: python script error

Have installed Python through Anaconda? That's most likelly the problem. I installed python 3.6 on its own and was able to integrate python script into PBI. Then I installed python 3.7 through Anaconda and got similar error for the same script that gave me no issues previously. I repointed PBI to the 3.6 interpreter and it runs fine again. So the issue is either with python 3.7 or with how it is managed by Anaconda. My guess is it's Anaconda and hence the irony that I went for it for convinience...

VShah Frequent Visitor
Frequent Visitor

Re: python script error

Thanks a lot for your reply. Will give it a try tomorrow. Will also try downloading python 3.7 directly instead of through Anaconda and check

 

EricGomez1001 Occasional Visitor
Occasional Visitor

Re: python script error

Which the solution?

Install anaconda to install pandas, without ananconda cannot be installed.

Matej_Samler Visitor
Visitor

Re: python script error

Hi,

Since PBI is giving the table as an input to your python step in the form of pandas.DataFrame, you need to have pandas installed on your computer, even though your script doesn't use it. Power BI needs to have access to the library in order to evaluate your code and pass inputs into it.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 49 members 1,051 guests
Please welcome our newest community members: