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

Python process ended unexpectedly

Python has stopped functioning for me, codes will not run at all. Python is installed correctly. I have Python 3.74, installed from the official link https://docs.microsoft.com/en-us/power-bi/desktop-python-scripts.

 

Even running the basic script described  in the knowledge page fails:

 

import pandas as pd

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

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

print (df)

 

and give the message

Can't display this visual

the Python process ended unexpectedly, so the visual can't be displayed. Please try running it again

 

I have tried:

  1. resetting my computer
  2. Updating powerbi
  3. updating Python
  4. Clearing Cache
  5. Updating packages

Nothing seems to be working

 

 

7 REPLIES 7
cgrimes Frequent Visitor
Frequent Visitor

Re: Python process ended unexpectedly

Additional Clues:

I attempted to run the script as a way to create a data table and got this error:

 

Unable to connect

We encountered an error while trying to connect.

Details: "ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: The file or directory is corrupted and unreadable"

Community Support Team
Community Support Team

Re: Python process ended unexpectedly

@cgrimes ,

 

To create a table using python pandas lib, you should click Editor Queries and click python script like below:

# 'dataset' holds the input data for this script
import pandas as pd

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

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

dataset = df

Capture.PNG 

Or create a blank query and input M code below:

let
    Source = Python.Execute("# 'dataset' holds the input data for this script#(lf)import pandas as pd#(lf)#(lf)data = [['Alex',10],['Bob',12],['Clarke',13]]#(lf)#(lf)df = pd.DataFrame(data,columns=['Name','Age'],dtype=float)#(lf)#(lf)dataset = df"),
    Result = Source{[Name="dataset"]}[Value]
in
    Result

The result will be as below:

1.PNG 

 

Community Support Team _ Jimmy Tao

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

cgrimes Frequent Visitor
Frequent Visitor

Re: Python process ended unexpectedly

The file works and loads the data properly, but when I try to load data through the first method you describe I get the same error:

 

Details: "ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined."

Community Support Team
Community Support Team

Re: Python process ended unexpectedly

@cgrimes ,

 

Have you installed anaconda and installed pandas or other site-packages through anaconda? If so, this issue should be related to the management of anaconda. You need to install python separately and install pandas using "pip".

 

Community Support Team _ Jimmy Tao

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

cgrimes Frequent Visitor
Frequent Visitor

Re: Python process ended unexpectedly

I did not use anaconda, I used the intalation procedure that is currently on Microsoft's site, installing from Python Directly.

 

I used pip to install the required packages, so I do not think this is the solution.

 

 

Community Support Team
Community Support Team

Re: Python process ended unexpectedly

@cgrimes ,

 

I still can't reproduce your issue. Could you please share your python code for further analysis?

 

Regards,

Jimmy Tao

freyes Frequent Visitor
Frequent Visitor

Re: Python process ended unexpectedly

Hello Cgrimes

Did you updated your windows recently?,  I updated my machine last Friday (Current Version 10.0.18362 Build 18362) and on Monday I had the same symptoms, I uninstalled completely the Python and then deleted manually all remaining folders and then installed again Python and now is working, that should work for you too.

 

As a comment, I do have Anaconda and a specific python installation for Power BI, obviously you have to install your packages also in that python installation for Power BI.

 

Regards

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 145 members 1,628 guests
Please welcome our newest community members: