ChatGPT解决这个技术问题 Extra ChatGPT

Can PyCharm list all of Python errors in a project?

I use python 2.7 in a virtual environment and PyCharm 2.7 (new build as of feb 07 2013).

Whenever I open a python file in it that has unambiguous errors (equivalent to compile errors in other languages, e.g. using undeclared variables, calling non-existing functions), it shows red stripes in the gutter of the file.

So, I discover errors randomly as I happened to navigate to a file that contains them. What I would really like is to be able to list all of the python errors in a separate window. The Visual Studio 2005/2008/2010/... IDE has a separate "Errors" view that lists all of them with file names and line numbers, and gives me the ability to click on any one of these errors and navigate directly to the source.

Does PyCharm have anything like this?


V
Vladimir

You can call Code|Inspect Code (formerly Analyze|Inspect Code, thanks to @CrackerJack9) to get all errors and warnings and ways to fix them. In result panel you can choose to see only errors (red/yellow button at the left side).


Woah. This feature is awesome. I never used it before. Very helpful!
What I find super annoying is that it shows errors in hundreds of files, I have yet to find the settings that only my own files should be checked.
@kap I think if you follow this answer it will filter out the directories you pick. Just tried it and it seemed to work.
@vladimir how to do it on the go. That is show it in the editor. My PyCharm is not showing right scroll errors, for example, variables not declared in my script.
f
forward

In Pycharm 2.6.3: Code -> Inspect Code


A
Andrey Vlasovskikh

Yes, run Analyze|Inspect Code and specify Whole project as the scope of analysis.