Reputation: 307
I am new to VS Code and I installed e.g. PySide for my tutorial project written in Python. I try to:
from PySide.QtGui import QDialog, QApplication, QVBoxLayout, QLineEdit, QTextBrowser
from PySide.QtCore import *
Although the code runs perfectly well using the imported modules, VS Code complains with:
[pylint] E0401:Unable to import 'PySide.QtGui'
or
[pylint] E0401:Unable to import 'PySide.QtCore'
This is very irritating, since I am able to use the modules as expected. I would guess an configuration issue, but do not know how to fix this.
Thank you very much.
See also:
Visual representation of VS Code complaining
EDIT:
I use a precompiled version of PySide. Could this be the reason for this behaviour?
Upvotes: 4
Views: 8404
Reputation: 385
Ensure that you have installed pylint in your environment (virtual env in case)
pip install pylint
Upvotes: 0
Reputation: 307
With the update 1.6 of Visual Studio Code and corresponding Python extension, the problem does not appear anymore.
Upvotes: 0
Reputation: 6852
@Andreas Schwab, You need to ensure pylint is installed in the python environment in which you have installed the PySide package. You will also need to ensure this same environment (python interpreter) is referenced in settings.json in the python.pythonPath setting.
You can find more details on these two here:
Upvotes: 2