Google AppEngine Python 3.7上的自定义库

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

我正在尝试在Google AppEngine Python 3.7标准环境中部署服务,这需要一组库作为依赖项。其中一个依赖项(GDAL 2.2.2)无法部署返回错误消息:

File upload done.
Updating service [pycloud-wms]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 04c3dcfd- 
230d-44ad-981a-8819a5f60130 status: FAILURE.
Error ID: 9E195939.
Error type: InternalError.
Error message: `pip_download_wheels` had stderr output:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-wheel-p30r4tj3/gdal/
error: `pip_download_wheels` returned code: 1.

我想知道这个错误的原因,如果有人知道在GAE上解决这个问题的方法。

注意:我知道我可以使用容器使用GAE Flexible环境部署我的应用程序,但两种方法之间的价格差异非常大。

python google-app-engine google-cloud-platform pip gdal
1个回答
4
投票

使用Python包管理器dependencies in the Google App Engine Python3.7 runtime安装pip

要在GAE Standard Python3.7运行时安装Python包,需要将其作为可安装pip的Python库提供。

GDAL package可以通过pip安装,但它需要安装libgdalgdal-devel平台软件包,这些软件包不会出现在App Engine Standard Python3.7运行时的基础运行时中。

解决方案是使用GAE Flex环境并首先安装这些平台级依赖项。

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