VS Code Python 当import自定义module时 报错 "could not be resolved"
在VS Code中编写python文件时,import自定义module报错 "could not be resolved"。
Import "[module]" could not be resolvedPylance (reportMissingImports)
解决:
在settings.json文件中添加:
"python.analysis.extraPaths": [ "./src", // 自定义模块的相对路径,可多个,可绝对路径 "./modules" ]
Less interests,more interest!