No name ‘QApplication’ in module ‘PyQt5.QtWidgets’ error in Pylint

I’ve figured out the issue, apparently Pylint doesn't load any C extensions by default, because those can run arbitrary code. So I found that if you create a system file in your project directory with the file named .pylintrc the rc file can whitelist this package to stop throwing errors by adding the following code in the rc file extension-pkg-whitelist=PyQt5. So essentially the issue isn’t PyQt5, it was the linter throwing false errors due to this.

Leave a Comment