I wrote a small program in VS code (screen attached), at first it worked and started, after a while this error appeared....

idk 20 Reputation points
2024-01-02T09:02:26.86+00:00
PS E:\VSC projects> & C:/Users/[user]/AppData/Local/Programs/Python/Python311/python.exe "e:/VSC projects/KNB.py" 

& : Имя "C:/Users/[user]/AppData/Local/Programs/Python/Python311/python.exe" not recognized as the name of a cmdlet, function, script file, or executable program. Check the correct spelling of the name and

 Also the presence and correctness of the path, then try again.

string:1 sign:3 

+ & C:/Users/[user]/AppData/Local/Programs/Python/Python311/python.exe ... 

+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

    + CategoryInfo          : ObjectNotFound: (C:/Users/[user]...n311/python.exe:String) [], CommandNotFoundException 

    + FullyQualifiedErrorId : CommandNotFoundException

The screenshot is attached below, there is free space on the disk. Before this, this error occurred and disappeared after some time, node.js was installed (The error is also present when starting other projects). This time, the error occurred after clearing the memory on drive C through the built-in Windows 10 utility in the disk properties. The path to the file is correct. And I checked its names, everything is correct. Program is 100% correct. I’m sinning more on VS code, but I don’t know how to fix that :(
Windows for business Windows Client for IT Pros User experience Other
Developer technologies Visual Studio Other
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2024-01-03T03:06:30.3266667+00:00

    Hi @idk, 

    Welcome to Microsoft Q&A! 

    You can try to run the VS Code as administrator.

    Then, search "Edit the system environment variables" in Windows Search box, open it, and ensure that the node.js location is added to Path environment variable.

    You can also add the folder “C:/Users/[user]/AppData/Local/Programs/Python/Python311/python.exe” to user variable. 

    If it doesn’t work, please report it to the dedicated GitHub-vscode forum where you would get support for this product. Thanks for your understanding. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.