gpt4 book ai didi

python - 为什么 python azure 函数无法在本地运行?

转载 作者:太空宇宙 更新时间:2023-11-03 20:26:59 26 4
gpt4 key购买 nike

我尝试使用 VSCode 在本地运行 python azure 函数,但它几乎立即自行关闭。

我已经按照教程创建了最简单的示例函数,但我相信我的机器上有一些配置错误。

几乎在启动该功能后我立即看到以下内容

[9/1/2019 4:52:07 PM] Found the following functions:
[9/1/2019 4:52:07 PM] Host.Functions.HttpTriggerTest
[9/1/2019 4:52:07 PM]
[9/1/2019 4:52:07 PM] Host initialized (573ms)
[9/1/2019 4:52:07 PM] Host started (590ms)
[9/1/2019 4:52:07 PM] Job host started
[9/1/2019 4:52:07 PM] python: can't open file 'C:\Users\First': [Errno 2] No such file or directory
[9/1/2019 4:52:07 PM] python: can't open file 'C:\Users\First': [Errno 2] No such file or directory
[9/1/2019 4:52:07 PM] Starting language worker process:python C:\Users\First Last\.vscode\extensions\ms-python.python-2019.3.6558\pythonFiles\ptvsd_launcher.py --default --host 127.0.0.1 --port 9091 --wait "C:\Users\First
Last\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py" --host 127.0.0.1 --port 64975 --workerId e9dc059f-128f-4e11-8363-797b4f1eeb1b --requestId c857107a-6b99-4d5a-9b71-d27827bfcad3 --grpcMaxMessageLength 134217728
[9/1/2019 4:52:07 PM] python process with Id=20920 started
Hosting environment: Production
Content root path: C:\file_location\Dev\PythonDev\MyAzureFunctions
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

HttpTriggerTest: [GET,POST] http://localhost:7071/api/HttpTriggerTest

[9/1/2019 4:52:07 PM] python: can't open file 'C:\Users\First': [Errno 2] No such file or directory
[9/1/2019 4:52:07 PM] Exceeded language worker restart retry count for runtime:python. Shutting down Functions Host
[9/1/2019 4:52:07 PM] Stopping host...
[9/1/2019 4:52:07 PM] Stopping JobHost
[9/1/2019 4:52:07 PM] Job host stopped
[9/1/2019 4:52:07 PM] Host shutdown completed.
Application is shutting down...

注意:错误消息指出文件 C:\Users\First 无法打开,因为它不存在。确实,它不存在。确实存在一个名为“C:\Users\First Last”的文件夹。也许我的 Windows 用户名中的空格导致了问题?

最佳答案

其实是因为你把目录放在单引号中'' ,您需要将它们放在双引号中 "" 。即"C:\Program Files\Python 3.4\python.exe"

如果这不是关键问题,请分享一些导致问题的代码。

关于python - 为什么 python azure 函数无法在本地运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57748653/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com