Reputation: 155
While proceeding Django Project Now, I'm having trouble with linter in VSC, pylint. First I'm using virtual environments with pipenv. and I'm using Visual Studio Code Version 1.19.1 with Windows 10. The trouble that I'm having is even though I installed pylint with pipenv and pip commands, VSC can't recognize it and Installation with Visual Studio Code can't work
First I figured out that python path settings pointed global setting, not virtual envs. so I edit settings.json for VSC like following way.
{
"python.pythonPath": "C:\\Users\\seungjinlee\\AppData\\Local\\lxss\\home\\seungjinlee\\.local\\share\\virtualenvs\\seungjingram-6b3oTnkI\\bin\\python",
}
from
but It didn't work as well.
Is it problem with bash for windows? I guess bash shell create virtual enviorments for Ubuntu. but I'm using editor VSC with windows 10 so it can't find pylint for windows,.,.,, plz help me..!
Upvotes: 5
Views: 6631
Reputation: 388
I had the same issue. What worked for me was:
Python: Select Interpreter
from the command palette (Ctrl+Shift+P
) and choosing the correct option (it should detect your virtual environment and suggest it, but if not, try setting python.pythonPath
as some as suggested, as well as python.venvFolders
and/or python.venvPath
. Also maybe try creating your virtual environment in the same folder as your project)Python: Select Linter
from the command palette and choosing pylint. Hope this helps.
Upvotes: 4
Reputation: 2433
I had the same problem on Mac OS. I solved it with the next sequence:
$ cd project_directory
$ pipenv install pylint
$ code .
So, the thing is to run VS Code from command line with activated virtual environment. I'm not sure if it helps for Windows, though.
For Windows a workaround may be to specify exact path to pylint in workspace settings:
"python.linting.pylintPath": "C:\\Users\\seungjinlee\\AppData\\Local\\lxss\\home\\seungjinlee\\.local\\share\\virtualenvs\\seungjingram-6b3oTnkI\\bin\\pylint"
Upvotes: 5