Skip to main content
Submitted by admin on 2 March 2022

Step 1: Download the latest version to Install from official website https://visualstudio.microsoft.com/downloads/.

Step 2: Go to extension icon and search Python and enabled the extension.

extension

Step 3: Verify and select correct Python version in VS.

 open your .py file and see below in status bar

path

Step 4: Set file Execution In current File Dir.

Go to File->Preferences->settings and search "Execute In File Dir" make sure you have checked box .

Step 5: Set Customize Run and Debug for current working directory.

click on create a launch.json file and choose "Python File"  and add  lines at bottom 

 "cwd": "${fileDirname}",

cwd