我正在 macOS 10.14.6 上运行最近升级的 VSCode 1.40.0,并在 venv 中运行 Python 3.6.5。在升级之前,我的代码可以正常工作(前一周,我最后一次对其进行一些工作)。此工作区是一组 Azure Functions,具有用于运行它的以下 launch.json 配置:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start",
"logToFile": true,
}
]
}
Run Code Online (Sandbox Code Playgroud)
目录结构为:
.
-- env (python env)
-- SharedCode
---- FunctionApp.py
-- TLoginEvents
---- tlogins.py
Run Code Online (Sandbox Code Playgroud)
当我在 VSCode 中运行代码时,出现以下 ModuleNotFoundError:
[11/13/19 5:17:08 PM] Executed 'Functions.TLoginEvents' (Failed, Id=c6e6b342-4250-4041-8d19-8ce4ae8bb736)
[11/13/19 5:17:08 PM] System.Private.CoreLib: Exception while executing function: Functions.TLoginEvents. System.Private.CoreLib: Result: Failure
[11/13/19 5:17:08 PM] …Run Code Online (Sandbox Code Playgroud)