在VS Code中编写python文件时,import自定义module报错 "could not be resolved"。
Import "[module]" could not be resolvedPylance (reportMissingImports)
https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings
解决:
在settings.json文件中添加:
"python.analysis.extraPaths": [ "./src", // 自定义模块的相对路径,可多个,可绝对路径 "./modules" ]