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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
spartanboy
Helper II
Helper II

Error while running python script in power bi desktop

Hello,

'm trying to use python scripting in power bi. I am referring documentation: here and here;

also confirming of installing appropriate packages in the folder, 

 
 

spartanboy_2-1673474516353.png

 

spartanboy_3-1673474535095.png

 

 

I am using an example script provided here

 

Please help in resolving below error,

spartanboy_5-1673474596051.png

 

@amitchandak 

1 ACCEPTED SOLUTION
LufengYuan
Frequent Visitor

 

I had ever encountered the similar problem and found the following solution in  the link How to run Python Script on powerBI - Stack Overflow. Not sure if it works for your situation?

 

If you are using Anaconda, it needs to be activated before you can use it. Simply open the Anaconda Prompt or run conda activate on the cmd prompt. Then start PBIDesktop from within the activated environment like:

(base) C:\> "Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

On Windows 10 you have to look for the PBIDesktop.exe in C:\Program Files\WindowsApps. Make sure the Python home directory (Anaconda3) has been added to the PBIDesktop global options in the Python scripting section too.

 

View solution in original post

2 REPLIES 2
spartanboy
Helper II
Helper II

Was able to activate via cmd, Thank you!!

 

spartanboy_0-1673555805322.png

 

LufengYuan
Frequent Visitor

 

I had ever encountered the similar problem and found the following solution in  the link How to run Python Script on powerBI - Stack Overflow. Not sure if it works for your situation?

 

If you are using Anaconda, it needs to be activated before you can use it. Simply open the Anaconda Prompt or run conda activate on the cmd prompt. Then start PBIDesktop from within the activated environment like:

(base) C:\> "Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

On Windows 10 you have to look for the PBIDesktop.exe in C:\Program Files\WindowsApps. Make sure the Python home directory (Anaconda3) has been added to the PBIDesktop global options in the Python scripting section too.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.