E0401:Unable to import 'flask'

前端 未结 6 1882
终归单人心
终归单人心 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:34

    I guess VS Code doesn't use the correct virtualenv.

    To select a virtualenv using the GUI, see Configuring Python environments.

    If you use the terminal and have code in your path, launch VS code from your workspace and the virtualenv will be loaded automatically:

    cd python-workspace
    code -n python-workspace
    

    (note: the -n is for new window)

    If this does not work, ensure that pylint is installed in your virtualenv (i.e. your are not using the global pylint). If it still does not work, have a look at this troubleshooting guide.

提交回复
热议问题