Raphael
Raphael

Reputation: 11

VSCode randomly gets SyntaxError when running Python but works after restarting VSCode

So I started with Python in VS Code. I can run my python Files but sometimes it just stopps working and I get this weird Error Message and don't know what it means:

& C:/Users/R.Kensy/AppData/Local/Programs/Python/Python310/python.exe d:/Python/Lists.py
  File "<stdin>", line 1
    & C:/Users/R.Kensy/AppData/Local/Programs/Python/Python310/python.exe d:/Python/Lists.py
    ^
SyntaxError: invalid syntax

Even tho there is nothing in Line 1 and I could run the code without a problem one minute ago. When I restart VSCode and dont change the code it just runs the code without an error.

Upvotes: 0

Views: 872

Answers (1)

Raphael
Raphael

Reputation: 11

I reinstalled everything and deleted all the extensions in VS Code, and it seems to work for now.

Upvotes: 1

Related Questions