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
- 分支
- 119
- 平均合併
- 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 於 48 天前認領。 未關閉
難度 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 於 25 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 55/100
Azure/azure-functions-python-worker#1903 ·
維護者通常 2 天內回覆
查看 Azure/azure-functions-python-worker 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 83/100
-
難度 2/5 1-3 小時 新手友好度 87/100
維護者通常 7 天內回覆
-
good first issue
難度 2/5 1-3 小時 新手友好度 78/100
MTSWebServices/RecTools#330 ·
-
area: web priority: P1 story
難度 2/5 1-3 小時 新手友好度 76/100
nfiasco/Quant-Time-Machine#151 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
autowarefoundation/autoware_carla_scenario#2019 ·
維護者通常 1 天內回覆