0

我是 azure 新手,在 Azure 门户上部署我的 python 函数时遇到了这个 KeyError,不知道是什么原因。

我在 requirements.txt 中只添加了一个包“tweepy == 3.8.0”,它似乎在部署期间的安装过程中崩溃了,而且 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/'

在此处输入图像描述

4

1 回答 1

0

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

于 2019-09-17T18:20:56.050 回答