E0401:Unable to import 'flask'

前端 未结 6 1890
终归单人心
终归单人心 2021-02-07 08:53

Am new in flask development and trying to import flask in my project but Pylint is giving this error in VSCode E0401:Unable to import \'flask

6条回答
  •  粉色の甜心
    2021-02-07 09:51

    Due to the fact that you are using a virtual environment, first of all it's required that Pylint is installed inside this virtual env.

    Furthermore, you need to add the following entry to your workspace settings to avoid the [pylint] E0401 error:

    "python.linting.pylintPath": "/path/to/your/virtualenv/bin/pylint"
    

    This overrides the user settings (global settings) and instructs VSCode to use the Pylint version within your virtual env (instead of the global one). That was probably the point you was missing ;-)

提交回复
热议问题