使用Django在谷歌应用引擎中部署PyYAML有多重要?

问题描述 投票:0回答:1

最近我尝试在谷歌应用引擎(标准环境 - Python版本3.7 - Django版本2.0.3)中部署我的django应用程序,但我发现了一个问题。

作为执行部署的上一步,我运行:

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是否存在问题?

django google-app-engine google-cloud-platform pyyaml
1个回答
0
投票

对于那些可能感兴趣的人,答案是这样的:

Google App Engine(标准环境)不允许安装PyYaml,因为默认情况下它安装了它:

https://cloud.google.com/appengine/docs/standard/python/refdocs/

因此,在requirements.txt中不添加PyYaml没有问题

PD:似乎库PyYaml被添加到requirements.txt文件中,因为pip正在识别文件夹中的yaml文件,并确定应用程序必须正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.