Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Visual Studio extension doesn't show errors

I'm used to use VS to code C++ and Eclipse to code python but lately I have tried VS for both languages.

I found something very difficult to understand that while VS autocompletes it doesn't warn you about errors before runtime.

No warning regarding non existent variables or methods

There is no warning regarding non existent variables or methods. I can't believe that VS does not warn about this kind of typical coding issues as it does for C++ code (as every IDE does).

What am I missing?

I tested this with VS2013 and VS2015.

I'm expecting something like:

enter image description here

Thanks

like image 997
user1618465 Avatar asked Jun 22 '16 03:06

user1618465


People also ask

Why is my VS Code not showing errors?

This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project. Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select Project, and then select the correct project that you want to work with.

How do I show errors in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.

How do I turn on VS Code errors?

Do Ctrl + p, and type "settings. json" You will find the file which contains the value "C_Cpp. errorSquiggles": "Disabled" Change it into Enabled.

Why is VS Code not detecting Python?

In VS Code, open the Settings with (Ctrl+,) then search settings for "Interpreter." There will an option for "Python: Default Interpreter Path." Set the location of your python.exe file. Open a new VS terminal with (Ctrl+Shift+`) to test the python command; you may need to restart VS Code.


1 Answers

In order to get the python detailed IntelliSense support in VS2015 you have to install python tools for visual studio which provide the following:

  1. CPython, PyPy, IronPython and more
  2. Detailed IntelliSense
  3. Interactive debugging
  4. Integrated with Visual Studio features
  5. Free and open-source

And the best thing, it's completely free.

Just download it from here:

https://www.visualstudio.com/en-us/features/python-vs.aspx

I hope it supports your question.

Update after comment:

You just need to refresh the Database. It works for me. Check to make sure the environment options are set (specifically path variable to PYTHONPATH) and the DB is refreshed.

Sometimes Deleting the __init__.py file in my source root directory did the trick

like image 89
DeJaVo Avatar answered Oct 24 '22 09:10

DeJaVo