django - 使用 Django 在谷歌应用引擎中部署时,PyYAML 有多重要?
问题描述
最近我尝试在谷歌应用引擎中部署我的 django 应用(标准环境 - Python 版本 3.7 - Django 版本 2.0.3),但我发现了一个问题。
作为执行部署的上一步,我运行:
pip freeze > requirements.txt
但是在部署时会产生这个错误:
Error message: `pip_download_wheels` had stderr output:
Failed building wheel for PyYAML
ERROR: Failed to build one or more wheels
error: `pip_download_wheels` returned code: 1.
当我意识到错误是由 PyYAML 引起的时,我尝试修改 requirements.txt 文件中的版本,但没有成功。
作为最后一步,我选择从我的 requirements.txt 文件中删除 PyYAML,在这种情况下它有效。应用程序已部署并正在运行。
但是我的问题是:在 requirements.txt 中不包含 PyYAML 的情况下进行部署是否有问题?
解决方案
对于那些可能感兴趣的人,答案是这样的:
Google app Engine(标准环境)不允许安装 PyYaml,因为默认情况下它已安装:
https://cloud.google.com/appengine/docs/standard/python/refdocs/
因此在 requirements.txt 中不添加 PyYaml 是没有问题的
PD:PyYaml 库似乎已添加到 requirements.txt 文件中,因为 pip 正在识别文件夹中的 yaml 文件并确定应用程序必须正常工作。
推荐阅读
- javascript - 将数组中对象的所有值相加但乘以数量
- bash - 将 DDL (2blocks) 与 bash 进行比较
- node.js - 来自 Nodejs 的 Oracle AQ 上的 JMS 文本消息
- python - AWS Lambda | Azure Python 库集成
- next.js - 为什么 Vercel 无法构建我的 Next.js tsx 应用程序?
- r - 当一个圆的面积为 0 时,维恩图的颜色错误
- apache-kafka - 当您更改用户 kafka 主题的分区数时,Kafka 流是否会调整内部主题的分区数?
- python - 将字符附加到空列表
- docker - 无法从 Swagger UI Docker 映像中的文件问题中读取
- rust - 自动将字符串解析为最合适的类型