pylint false positive E0401 import errors in vscode while using venv

前端 未结 4 1190
醉话见心
醉话见心 2021-02-05 06:40

I created a venv using python3.6 on my mac os in this folder /Users/kim/Documents/Apps/PythonApps/python36-miros-a3

I ran a pip install pylint

4条回答
  •  孤独总比滥情好
    2021-02-05 07:26

    Expanding on Gatmando's answer, you need to tell vscode to use the pylint in your .env instead of the global pylint:

    In your workspace settings file: .vscode/settings.json, add python.linting.pylintPath and point it to pylint package in your virtualenv:

    {
        "python.pythonPath": ".env/bin/python",
        "python.linting.pylintPath": ".env/bin/pylint"
    }
    

提交回复
热议问题