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.
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:
Nothing seems to be working
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
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
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:
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |