简体   繁体   中英

Visual Studio Code w/ Python: “Problems” doesn't work anymore & variable-color suddenly disabled

I use Windows 10, Visual Studio Code (1.54.2) and Python 3.8.5 as enviroment for my projects in Visual Studio.

Yesterday I wanted to give PyPy3.7 a try instead of Python 3.8.5 enviroment and selected in VS Code:

Ctrl + Shift + p ---> Python: Select Interpreter> PyPy3.7

After this, my Antivirus went a bit nuts and it blocked and deleted several files associated with PyPy3.7. So I completely deleted PyPy3.7 and switched back to Python 3.8.5.

However, now all my global and local variables are in white color. Also, the "Problems" panel seems to be disabled too. It always says: "No problems have been detected in workspace", also after purposely making mistakes in my code to make it raise an error.

I reinstalled VS Code completely, but the issue somehow persists. Anyone who can help me out with this?

  1. Open an external Terminal and run python to check if python3.8.5 works well: 在此处输入图像描述 If not, please reinstall python.

  2. About the phenomenon:

the "Problems" panel seems to be disabled too. It always says: "No problems have been detected in workspace", also after purposely making mistakes in my code to make it raise an error.

Delete contents between { } in User Settings.json to make VS Code to roll back to default status.

Turn to C:\Users\...\AppData\Roaming , delete the folder Code .

then reinstall VS Code and Python extension. Besides, it's recommended to install Pylance and set is as Language Server in settings.json.

"python.languageServer": "Pylance",

Try this and see if the question goes away.

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