-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Troubleshooting Linting
Don Jayamanne edited this page Jun 22, 2016
·
8 revisions
- Scenario: You have a module installed, however the linter in the IDE is complaining about not being able to import the module, hence you have error messages being displayed.
- Cause: The Python extension is most likely using the wrong version of Pylint.
Solution 1: (configure workspace settings to point to fully qualified python executable):
- Open the workspace settings (settings.json)
- Identify the fully qualified path to the python executable (this could even be a virtual environment)
- Ensure Pylint is installed for the above python environment
- Configure the setting "pythonPath" to point to (previously identified) fully qualified python executable.
"python.pythonPath": "/users/xxx/bin/python"
Solution 2: (open VS Code from an activated virtual environment):
- Open the terminal window
- Activate the relevant python virtual environment
- Ensure Pylint is installed within this virtual environment
pip install pylint
- Close all instances of VS Code
- Launch VS Code from within this terminal window
(this will ensure the VS Code process will inherit all of the Virtual Env environment settings)