Python 3.11 Function Apps may fail to load with No module named 'pkg_resources'
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by checking the Python 3.11 worker startup and function indexing behavior described in the issue, then look for where the worker image or dependency environment supplies setuptools. The issue identifies a mitigation in requirements.txt and the setuptools version change from 65.5.1 to 84.2.1. Done means affected apps can load functions when pkg_resources is imported; the issue does not name a test or code entry point.
由索引模型根据 Issue 内容生成。
描述
Description
Some Python 3.11 Azure Function Apps may fail to load their functions after receiving an updated platform image. Logs show:
ModuleNotFoundError: No module named 'pkg_resources'
The Functions host may start, but function indexing fails, leaving affected functions unavailable. This can occur without changes to application code or dependencies.
Apps are affected when their code—or an installed dependency—imports pkg_resources and relies on the platform image to provide it.
Cause
The updated Python 3.11 image upgraded setuptools from 65.5.1 to 84.2.1. Setuptools removed the deprecated pkg_resources module starting with 82.0.0.
Applications that do not explicitly install a compatible setuptools version can therefore lose access to pkg_resources when the underlying image updates.
Mitigation
Add the following dependency to your app’s requirements.txt , replacing any existing setuptools requirement, and redeploy:
setuptools>=78.1.1,<82
This installs an application-local version of setuptools that still includes pkg_resources , rather than relying on the platform image’s copy. Restarting the app alone does not install this dependency.
For a long-term solution, update affected dependencies or migrate to supported alternatives such as importlib.metadata and importlib.resources .
- 主要语言
- Python
- 星标
- 357
- 派生
- 118
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 10
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/azure-functions-python-worker 的其他 Issue
-
[Bug] ASGI cookie conversion serializes an absent Domain attribute and breaks __Host- cookies可能已有人在做 @tharun06 于 47 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Azure/azure-functions-python-worker#1902 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 28/100
Azure/azure-functions-python-worker#1908 · 2 条评论 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
Azure/azure-functions-python-worker#1906 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
Azure/azure-functions-python-worker#1904 ·
维护者通常 2 天内回复
-
[Python 3.14 proxy worker] Missing sys.modules["__main__"] breaks multiprocessing spawn可能已有人在做 @Fire162 于 24 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
Azure/azure-functions-python-worker#1903 ·
维护者通常 2 天内回复
查看 Azure/azure-functions-python-worker 的全部 Issue
相似的 Issue
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)可能已有人在做 @geyazheng 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
langchain-ai/langchain-aws#1469 ·
维护者通常 1 天内回复
-
GCToggler leaves collection enabled if the body re-enables it可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 7 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
doronz88/pymobiledevice3#2176 ·
维护者通常 1 天内回复
-
b4b usability
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复