在VS Code中編寫python文件時,import自定義module報錯 "could not be resolved"。
Import "[module]" could not be resolvedPylance (reportMissingImports)

解決:
在settings.json文件中添加:

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

解決:
在settings.json文件中添加:

"python.analysis.extraPaths": [ "./src", // 自定義模塊的相對路徑,可多個,可絕對路徑 "./modules" ]
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。