进口“烧瓶"无法从源 Pylance 解析(reportMissingModuleSource) [英] Import "flask" could not be resolved from source Pylance (reportMissingModuleSource)

查看:195
本文介绍了进口“烧瓶"无法从源 Pylance 解析(reportMissingModuleSource)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我写作时

from flask import Flask

flask 下方出现一条黄线,并说明导入flask"无法从源 Pylance (reportMissingModuleSource) 解析.此外,我也能够成功地使用此包进行工作.但问题是,我不能很好地为类和方法使用自动建议.

进一步:

  1. 我已检查是否已成功安装flask.
  2. 我也访问了这个线程

    请使用命令pip --version";查看模块安装工具pip"的源码,模块安装在这个位置:

    然后,我们可以使用命令pip show flask";检查模块flask"的安装位置:(检查模块的安装位置是否与VSCode左下角显示的Python环境一致.)

    如果reportMissingModuleSource"此处仍显示消息,请重新加载 VS Code.

    (F1, Developer: Reload Window)

    When I am writing

    from flask import Flask
    

    One Yellow line is coming up under flask and stating Import "flask" could not be resolved from source Pylance (reportMissingModuleSource) . Also, I am able to do the work with this package also successfully. But the thing is, I am not able to use autosuggesstions for Classes and methods very well.

    Further:

    1. I have checked that flask is installed successfully.
    2. Also I visited this thread https://github.com/microsoft/pylance-release/issues/236

    And I set up my settings.json in vscode as follows:

    "python.analysis.extraPaths": [
        "/media/sarimurrab/New Volume/COURSES/Flask/FlaskMigrateforDatabaseMigrations/2"
    ]
    

    But Still, unable to resolve the error.

    解决方案

    When I did not install the module "flask" in the Python environment currently used in VSCode:

    Please use the command "pip --version" to check the source of the module installation tool "pip", the module is installed at this location:

    Then, we can use the command "pip show flask" to check the installation location of the module "flask": (It checks whether the installation location of the module is consistent with the Python environment displayed in the lower left corner of VSCode.)

    If the "reportMissingModuleSource" message is still displayed here, please reload VS Code.

    (F1, Developer: Reload Window)

    这篇关于进口“烧瓶"无法从源 Pylance 解析(reportMissingModuleSource)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆