Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
VijayAntonyM
Helper I
Helper I

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,

VijayAntonyM_0-1712140303072.png

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

VijayAntonyM_1-1712140459422.png

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

 

thanks

M. Vijay Antony

1 REPLY 1
Anonymous
Not applicable

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

https://www.python.org/

vjiewumsft_0-1712211365403.png

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.

vjiewumsft_1-1712211410158.png

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

vjiewumsft_2-1712211419527.png

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

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.