进口“烧瓶"无法从源 Pylance 解析(reportMissingModuleSource) [英] Import "flask" could not be resolved from source Pylance (reportMissingModuleSource)
问题描述
当我写作时
from flask import Flask
flask 下方出现一条黄线,并说明导入flask"无法从源 Pylance (reportMissingModuleSource) 解析.此外,我也能够成功地使用此包进行工作.但问题是,我不能很好地为类和方法使用自动建议.
进一步:
- 我已检查是否已成功安装flask.
- 我也访问了这个线程
请使用命令
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:
- I have checked that flask is installed successfully.
- 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屋!