【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表

简介: 【Azure Function】发布 Python Function 到 Azure 成功,但是无法显示Function列表

问题描述

发布Python Function到Azure Function App服务,发布成功后,在Overview页面却无法查看到这个Function,进入Kudu站点,查看Function Log,发现错误信息为:

"module not found" error: "Failure Exception: ImportError: libpq.so.5: cannot open shared object file: No such file or directory. Cannot find module."

 

问题解答

经过调查,在网上发现相同的错误信息。 原因是无法加载psycopg2模块,需要使用 psycopg2-binary。

(在 requirements.txt 中,使用  psycopg2-binary )

 

根据文档提示修改后,Function显示并执行成功!

 

参考资料

Unable to get Azure Function Python 3.8 to work in Azure #1586: https://github.com/Azure/Azure-Functions/issues/1586

python function app works locally but not when deployed :https://learn.microsoft.com/en-us/answers/questions/174155/python-function-app-works-locally-but-not-when-dep

 

目录
打赏
0
0
0
0
194
分享
相关文章
【Azure Function】Function App门户上的Test/Run返回错误:Failed to fetch
Running your function in portal requires the app to explicitly accept requests from https://portal.azure.cn. This is known as cross-origin resource sharing (CORS).Configure CORS to add https://portal.azure.cn to allowed origins.
|
19天前
|
C#
【Azure Function】Function App出现System.IO.FileNotFoundException异常
Exception while executing function: xxxxxxx,The type initializer for 'xxxxxx.Storage.Adls2.StoreDataLakeGen2Reading' threw an exception. Could not load file or assembly 'Microsoft.Extensions.Configuration, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the
113 64
【Azure Function】C#独立工作模式下参数类型 ServiceBusReceivedMessage 无法正常工作
Cannot convert input parameter 'message' to type 'Azure.Messaging.ServiceBus.ServiceBusReceivedMessage' from type 'System.String'.
111 73
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
38 11
【Azure Developer】Python代码调用Graph API将外部用户添加到组,结果无效,也无错误信息
根据Graph API文档,在单个请求中将多个成员添加到组时,Python代码示例中的`members@odata.bind`被错误写为`members@odata_bind`,导致用户未成功添加。
51 10
|
2月前
|
Python列表
Python列表。
55 8
[oeasy]python054_python有哪些关键字_keyword_list_列表_reserved_words
本文介绍了Python的关键字列表及其使用规则。通过回顾`hello world`示例,解释了Python中的标识符命名规则,并探讨了关键字如`if`、`for`、`in`等不能作为变量名的原因。最后,通过`import keyword`和`print(keyword.kwlist)`展示了Python的所有关键字,并总结了关键字不能用作标识符的规则。
46 9
python--列表list切分(超详细)
通过这些思维导图和分析说明表,您可以更直观地理解Python列表切分的概念、用法和实际应用。希望本文能帮助您更高效地使用Python进行数据处理和分析。
78 14
python--列表list切分(超详细)
通过这些思维导图和分析说明表,您可以更直观地理解Python列表切分的概念、用法和实际应用。希望本文能帮助您更高效地使用Python进行数据处理和分析。
134 10

热门文章

最新文章

推荐镜像

更多
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等