Skip to main content
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.

Frequent Visitor

Python Visual in Power BI Desktop

Hi Team,


I am trying to use Python Visual from MS Power BI Desktop, I am getting below error while loading Python script from Get Data-> Python Script,


Same time  i am also unable to install the Python libraries such Pandas and Matplotlib,


Kindly help us on this and support me to use the python visuals in power bi



M. Vijay Antony

Community Support
Community Support

Hi @VijayAntonyM ,

Based on the error information, python script leads to the error.

please try the following methods:

1.Intall python and enable python scripting.

Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Learn


2.Create the python script.



import pandas as pd
data = [['Alex',10],['Bob',12],['Clarke',13]]
df = pd.DataFrame(data,columns=['Name','Age'])
print (df)



3.Select get data and choose Python script.


4.On the python script screen, paste the python script.


You can view the following documents to learn more about how to run python scripts in power bi desktop.

Run Python scripts in Power BI Desktop - Power BI | Microsoft Learn

Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Learn


Best Regards,

Wisdom Wu

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

Helpful resources

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


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.