When I try to run Python code in Vs code this appears in the output I have already tried reinstalling both python and Vs code.Ive alos tried other solutions on stackoverflow and none have worked
Asked
Active
Viewed 3,375 times
-1
-
1Is python in PATH? – Ignatius Reilly Jul 13 '22 at 16:33
-
Please explain what you have tried already, so we don't have to go through the same debugging steps that have already failed for you. – Ignatius Reilly Jul 13 '22 at 16:35
-
Open Command Prompt and type `python`. What message do you see? – Bunny Jul 13 '22 at 16:35
-
Why would you expect reinstalling java to make python work? Sounds like you need to install **python**. – martineau Jul 13 '22 at 16:35
-
sorry not java i meant python – Indices Jul 13 '22 at 16:39
-
When i type python into the command line it says"'python' is not recognized as an internal or external command, operable program or batch file. " – Indices Jul 13 '22 at 16:40
-
When iclick run python file it works but not when i do it in the output part – Indices Jul 13 '22 at 16:47
-
On Windows Python usually installs as `py`. If that fails, you can try `python3`. – btilly Jul 13 '22 at 16:51
-
Go through this [doc](https://www.javatpoint.com/how-to-set-python-path) or check this [answer](https://stackoverflow.com/a/4855685) and add your path where python is installed and not same to same as of answer/doc. – GodWin1100 Jul 13 '22 at 17:26
-
1Does this answer your question? [How to add to the PYTHONPATH in Windows, so it finds my modules/packages?](https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-so-it-finds-my-modules-packages) – GodWin1100 Jul 13 '22 at 17:26
-
https://stackoverflow.com/search?q=%5Bpython%5D+is+not+recognized+as+an+internal+or+external+command%2C+operable+program+or+batch+file – phd Jul 13 '22 at 18:45
-
When i open vscode i get this. The environment variable 'Path' seems to have some paths containing the '"' character. The existence of such a character is known to have caused the Python extension to not load. If the extension fails to load please modify your paths to remove this '"' character. – Indices Jul 14 '22 at 13:23
1 Answers
0
If you already installed python on Windows, you need to add Python command in the PATH variable.
The complete path of python.exe can be added by:
- Right-click This PC and go to Properties
- Click on the Advanced system settings in the menu on the left.
- Click on the Environment Variables button on the bottom right.
- In the System variables section, select the Path variable and click on Edit.
The next screen will show all the directories that are currently a part of the PATH variable. Click on New and enter Python’s install directory. Now you can use python directly from the command prompt without having to write its full path location.
Try executing the command py --version
; it will output the version of Python installed on your system.

codecracker
- 44
- 4
-
-
1well, VS Code is a code editor, not a compiler...what it basically does is run your python file in a command prompt...install python, and add it to PATH as suggested above – codecracker Jul 13 '22 at 16:49
-
-