Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'No name 'QtWidgets' in module 'PyQt5' and 'Unable to import 'PyQt5.QtWidgets' errors in vscode #3729

Closed
KikeSenpai opened this issue Jul 8, 2020 · 4 comments

Comments

@KikeSenpai
Copy link

Hello I am following the suggestion in the link below, about posting new issues for specifics modules in this case PyQt5
#1524 (comment)

Steps to reproduce

I imported the following classes from PyQt5 in order to build a Message Box:

from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import (
    QApplication, QWidget, QLabel, QMessageBox, QLineEdit, QPushButton
)

Also I have the following setting in my settings.json:

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

Thanks to this some error messages stopped showing but I still get the following errors in the problems tabs of vscode:

Current behavior

'No name 'QtWidgets' in module 'PyQt5'
'Unable to import 'PyQt5.QtWidgets'
'No name 'QtGui' in module 'PyQt5'
'Unable to import 'PyQt5.QtGui'

Expected behavior

No errors of this kind

pylint --version output

pylint 2.5.3 with Python 3.7.3 using the anaconda distributor

@AWhetter
Copy link
Contributor

I can't reproduce this issue. Are you sure that the message is coming from pylint and not PyLance or some other part of vscode?
What versions of astroid and PyQt5 do you have?

@Neighbouring
Copy link

I found the same problem. This problema was solved just with a Virtualenv.

@bersbersbers
Copy link

Had the same problem with PySide6 on Linux. Problem seems to have been that system dependencies were not installed. sudo apt-get -y install xorg libxkbcommon0 helped.

@RokeJulianLockhart
Copy link

https://stackoverflow.com/q/56726580/9731176 might be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants