在 Azure 上部署 Python Function App 时出现 KeyError

KeyError when deploying Python Function App on Azure

我是 azure 的新手,在 Azure 门户上部署我的 python 函数时遇到此 KeyError,不确定是什么原因。

我只添加了一个包,"tweepy == 3.8.0" 在我的 requirements.txt 中,它似乎在部署期间的安装过程中崩溃了,PySocks 包可能只是 tweepy 的依赖项包。

我在本地调试的时候没有这样的问题。该函数在本地运行绝对正常。

我该如何解决这个部署问题?

错误:

There was an error restoring dependencies. Traceback (most recent call last):
  File "C:\Users\anjan\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\anjan\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\anjan\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\tools\python\packapp\__main__.py", line
234, in <module>
    main()
  File "C:\Users\anjan\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\tools\python\packapp\__main__.py", line
60, in main
    find_and_build_deps(args)
  File "C:\Users\anjan\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\tools\python\packapp\__main__.py", line
142, in find_and_build_deps
    wheel.install(paths, maker)
  File "C:\Users\anjan\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\tools\python\packapp\distlib\wheel.py",
line 519, in install
    row = records[u_arcname]
KeyError: 'PySocks-1.7.0.dist-info/'

"func: pack" 任务一直是用户的常见问题。我可以通过尝试旨在解决此问题的预览功能来解决它​​:https://github.com/microsoft/vscode-azurefunctions/wiki/Server-Side-Build