简体   繁体   中英

Can't run Python programs in VS Code - 'cmd' is not recognized as an

I've just installed the Python extension, restarted VS Code and updated it, but when I try to run a Python program and select the debugging configuration as (Python File), I get this message:

E:\SaifWork\code\workspaces\PY\self-taught dev>cd "e:\SaifWork\code\workspaces\PY\self-taught dev" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Users\saif\AppData\Local\Programs\Python\Python37-32\python.exe c:/Users/saif/.vscode/extensions/ms-python.python-2019.5.18678/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 50135 "e:\SaifWork\code\workspaces\PY\self-taught dev\problem1.py" "
'cmd' is not recognized as an internal or external command,
operable program or batch file.

I have all the python directories added to the PATH variable.

Seems like the Python directories are added to the PATH, but your System32 (containing the cmd.exe, Windows's command-line interpreter) isn't. Try adding it manually.

EDIT: the System32 folder path is %SystemRoot%\\system32 , which is very often C:\\Windows\\system32 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM