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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.