How to Remove Red Lines Indicating Errors when Import Error?

Answered

Hello, 

I am quite a beginnner with PyCharm, so I haven't found all the menus and functions yet. When I have a very basic and simple program, for example:

As you see, the code is correct and everything works fine when I press 'Run'. But how can I remove those red-underlined import errors with screen and images? Is there a function to only turn off import errors? My problem is that I don't want to be confused with errors that don't make sense like the import one as I imported already at the top.

 

Thank you so much!

1
3 comments

I have created a bug report: https://youtrack.jetbrains.com/issue/PY-41151

Please follow the issue to be notified about the updates. If you're unfamiliar with YouTrack, please see https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

As a workaround you can alt+enter on the unresolved reference and select "Ignore unresolved reference | suppress for statement/function"

0
Avatar
Permanently deleted user

Aha, I see. Thanks for the reply. Another Question - is there a way to turn off these error messages long term? If not, can I turn off the error messages all the way? 

0

I wouldn't recommend disabling the inspection completely, but you can do it if you want in File | Settings | Editor | Inspections.

Or you could switch the Highlighting level:

 

1

Please sign in to leave a comment.