4

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?

3
  • Are you using a virtualenv by chance? (virtual environment)? Commented Sep 11, 2016 at 6:30
  • No. Not that I am aware of. Commented Sep 11, 2016 at 6:33
  • Possible duplicate of Visual Studio Code pylint: Unable to import 'protorpc' Commented Mar 21, 2019 at 15:30

3 Answers 3

2

@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:

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately, the solution provided here: github.com/DonJayamanne/pythonVSCode/wiki/… did not work. I have not setup a virtual environment, yet.
Andreas Schwab, please could you raise an issue for this on GitHub. It would be easier to resolve it there as we can share more information such as screen dumps and the like. E.g. sharing your launch.json and settings.json, etc
0

With the update 1.6 of Visual Studio Code and corresponding Python extension, the problem does not appear anymore.

Comments

0

Ensure that you have installed pylint in your environment (virtual env in case)

pip install pylint 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.