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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.