e0cba105b6
问题原因: - pysnmp==7.1.15 使用已废弃的 asyncio.coroutine 装饰器 - 该装饰器在 Python 3.11 中被完全移除,导致导入失败 解决方案: - 替换为 pysnmp-lextudio==5.0.31 - 这是社区维护的分支,兼容 Python 3.6+ - API 完全兼容,无需修改业务代码 验证: - Python 3.10 & 3.11 均可正常导入 - FastAPI 应用可正常加载 (95 routes) - SNMPService.OID_SYS_DESCR 可正常访问
24 lines
597 B
Plaintext
24 lines
597 B
Plaintext
# Python 3.10+ 兼容版本
|
||
fastapi==0.110.0
|
||
uvicorn[standard]==0.27.1
|
||
sqlalchemy==2.0.28
|
||
pymysql==1.1.0
|
||
cryptography==42.0.5
|
||
pydantic==2.6.4
|
||
pydantic-settings==2.2.1
|
||
celery==5.3.6
|
||
redis==5.0.3
|
||
python-multipart==0.0.9
|
||
alembic==1.13.1
|
||
# 注意: pysnmp 7.x 与 Python 3.10+/asyncio 存在兼容性问题
|
||
# 使用 lextudio 维护的分支(向后兼容,支持 Python 3.6+)
|
||
pysnmp-lextudio==5.0.31
|
||
scapy==2.5.0
|
||
python-dotenv==1.0.1
|
||
passlib[bcrypt]==1.7.4
|
||
httpx==0.27.0
|
||
python-jose[cryptography]
|
||
bcrypt==3.2.2
|
||
# typing-extensions 提供 Python 3.10+ 的向后兼容支持
|
||
typing-extensions>=4.5.0
|