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
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
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.