在VS Code中編寫python文件時,import自定義module報錯 "could not be resolved"。
Import "[module]" could not be resolvedPylance (reportMissingImports)
解決:
在settings.json文件中添加:
"python.analysis.extraPaths": [ "./src", // 自定義模塊的相對路徑,可多個,可絕對路徑 "./modules" ]