我創建了一個myutils.py檔案,將其添加到PYTHONPATHvia.bashrc并在實際運行時正確匯入。
但是,當我在 vscode 中查看匯入庫的檔案時,它無法識別它并給我警告Import "myutils" could not be resolved PylancereportMissingImports 。
我如何向 vscode 顯示我希望它快取我的自定義模塊的內容?
uj5u.com熱心網友回復:
選擇口譯員可能有助于解決問題。

uj5u.com熱心網友回復:
在settings.json檔案中,您必須添加從中匯入的檔案夾的路徑myutils:
"python.analysis.extraPaths": [
"<path to the folder that contains myutils.py>",
]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/383358.html
標籤:Python 视觉工作室代码 模块 vscode-设置
