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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.