Search code examples
pythonpython-3.xvisual-studiovisual-studio-2017intellisense

Python in Visual Studio: Erroneous errors


I'm not sure if this is an appropriate question for this site, but I'm not sure where else to ask. I've been using MS Visual Studio Professional 2017 to build Python code for a Blender add-on for months now, and have been dealing with this issue since I started. I use the IDE on two PCs (Alienware laptop and custom desktop), and have the same problem on both computers. I don't debug or execute code within VS (although I would if I knew how). I just edit the code, then refresh/test in Blender.

The problem

For some reason, I get random intellisense errors while coding (see image below), even when there are no issues. If I delete the error lines, wait a second, then undo the deletion, the errors will go away. So I think this is some type of syncing or refreshing issue. An error occurs while I'm typing, which becomes fixed after I complete the statement, but the error remains indefinitely, until the text is re-parsed.

I included Python capabilities using the Visual Studio installer. I don't believe I have any add-ons enabled. Is anyone familiar with this problem or does anyone know a possible solution?

Snapshot of erroneous errors:

Visual Studio Python Intellisense Errors


Solution

  • Sorry but I have no direct answer for that, I suggest you can try:

    1.Close all VS instance and delete the .vs folder in Solution folder, then restart VS after cleaning the VS cache.

    2.Reset all VS settings like this. You can backup your custom settings before reset them.

    3.Update vs to latest VS15.9.16. (The Intellisense works well in my machine with VS15.9.16 + python3.6)

    Or you may get a similar issue like this, change the setting to Insert Spaces first, and then do delete the error lines, wait a second, then undo the deletion again to remove current errors, then check if you'll get this issue in the further development after that. May it helps :)