No name 'QApplication' in module 'PyQt5.QtWidgets' error in Pylint

I think the simplest way to remove package import errors is by going into vscode's JSON settings by Ctrl+Shift+P, search "settings" and choose Preferences: Open Settings (JSON) and adding this line to the dict:

"python.linting.pylintArgs": ["--extension-pkg-whitelist=PyQt5"]

If you want to add multiple packages, just add it with the first, separated by a comma like this:

"python.linting.pylintArgs": ["--extension-pkg-whitelist=PyQt5,otherPkg"]

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.