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
cgrimes
Advocate II
Advocate II

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
freyes
Frequent Visitor

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

cgrimes
Advocate II
Advocate II

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"

@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.

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."

@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.

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.

 

 

@cgrimes ,

 

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

 

Regards,

Jimmy Tao

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.