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
Anonymous
Not applicable

VS Code don't open as editor for Python scripts

I'll to make a Python script in Power BI as data source. That script I want to write in VS Code (Visual Studio Code). The default app for .py files is VS Code and at the settings of Power BI under "Python scripting", I've selected "Default OS program for .PY files".

image.png

But everythime I'll to create a Python script, this window occure instead of VS Code.

image.png

I'm also not able to open VS Code on another way. I've added the path to VS Code, in the hope it would work, but it didn't...

image.png

I'll use VS Code 'cause you've syntax highlighting and error messages etc.

3 REPLIES 3
Anonymous
Not applicable

I have same problem 

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Have you read the guide docuement about running python script in Power BI Desktop?

Please refer to the steps in this document which gives an example for Visual Studio Code.

By default, Power BI Desktop will launch Visual Studio Code as the external Python IDE if it's installed on your local computer; if Visual Studio Code is not installed and you have Visual Studio, that will be launched instead. If neither of those Python IDEs is installed, the application associated with .PY files is launched.

Based on your screenshots, it seems that you may not install the Visual Studio Code as the external Python IDE on your local device.

Another reference: Use an external Python IDE with Power BI

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-piga-msft: The option Visual Studio Code doesn't appear at the "Detected Python IDEs".

image.png

This Python IDEs I've installed:

  • VS Code (OS default application for .py files)
  • VS Code Insiders
  • VS 2017
  • VS 2019
  • Notepad++

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.