If python command is not working in visual studio code’s terminal window. You can follow below steps to setup PATH variable
Step 1:
Set up Path variable only for this visual studio code session. Run below command in visual studio code terminal where “C:\Program Files\Python36” is python install directory. You can choose a different one based on python version installed .
$env:path=“$env:Path; C:\Program Files\Python36″
This is just a temporary fix and I recommend Step 2 which will make the command available permanently.
Step 2:
Set “C:\Program Files\Python36” or your python install directory as Path environment variable using below steps
- Select Start, select Control Panel. double click System, and select the Advanced tab.
- Click Environment Variables. …
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. …
Now We are set to use Python in Visual Studio.