Skip to main content
 首页 » 编程设计

AppEngine Python 3.7 Standard 中的 python3-saml 安装失败

2024年12月31日20jirigala

我在 AppEngine Python 3.7 Standard 中有一个简单的设置,只有两个文件:requirements.txt 和 app.yaml。

requirements.txt 文件是:

Flask==1.0.2 
python3-saml==1.4.1 

app.yaml 文件是:

runtime: python37 
service: myservice 

当我运行 gcloud app deploy 时,出现以下错误:

ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build f8eaa62c-0385-4c1a-9788-b7765313ae08 status: FAILURE. 
Build error details: {"message": "`pip_download_wheels` had stderr output:\n  Failed building wheel for xmlsec\nERROR: Failed to build one or more wheels\n\nerror: `pip_download_wheels` returned code: 1", "code": 1, "type": "USER_ERROR"}. 

关于如何解决这个问题有什么想法吗?

提前谢谢你。

Cloud Build 日志中的相关部分:

Step #1 - "builder": Building wheels for collected packages: itsdangerous, xmlsec, MarkupSafe 
Step #1 - "builder":   Running setup.py bdist_wheel for itsdangerous: started 
Step #1 - "builder":   Running setup.py bdist_wheel for itsdangerous: finished with status 'done' 
Step #1 - "builder":   Stored in directory: /tmp/tmpWitMY2/wheel 
Step #1 - "builder":   Running setup.py bdist_wheel for xmlsec: started 
Step #1 - "builder":   Running setup.py bdist_wheel for xmlsec: finished with status 'error' 
Step #1 - "builder":   Complete output from command /env/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-wheel-o2h0m8_p/xmlsec/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-229ft_of: 
Step #1 - "builder":   running bdist_wheel 
Step #1 - "builder":   running build 
Step #1 - "builder":   running build_ext 
Step #1 - "builder":   ********************************************************************************* 
Step #1 - "builder":   Could not find xmlsec1 config. Are libxmlsec1-dev and pkg-config installed? 
Step #1 - "builder":   ********************************************************************************* 
Step #1 - "builder":    
Step #1 - "builder":   ---------------------------------------- 
Step #1 - "builder":   Running setup.py clean for xmlsec 
Step #1 - "builder":   Running setup.py bdist_wheel for MarkupSafe: started 
Step #1 - "builder":   Running setup.py bdist_wheel for MarkupSafe: finished with status 'done' 
Step #1 - "builder":   Stored in directory: /tmp/tmpWitMY2/wheel 
Step #1 - "builder": Successfully built itsdangerous MarkupSafe 
Step #1 - "builder": Failed to build xmlsec 
Step #1 - "builder":  
Step #1 - "builder": INFO     `pip_download_wheels` had stderr output: 
Step #1 - "builder":   Failed building wheel for xmlsec 
Step #1 - "builder": ERROR: Failed to build one or more wheels 
Step #1 - "builder":  
Step #1 - "builder": ERROR    error: `pip_download_wheels` returned code: 1 
Step #1 - "builder": INFO     pip_download_wheels took 6 seconds 
Step #1 - "builder": INFO     build process for FTL image took 9 seconds 
Step #1 - "builder": INFO     full build took 9 seconds 
Step #1 - "builder": ERROR    `pip_download_wheels` had stderr output: 
Step #1 - "builder":   Failed building wheel for xmlsec 
Step #1 - "builder": ERROR: Failed to build one or more wheels 
Step #1 - "builder":  
Step #1 - "builder": error: `pip_download_wheels` returned code: 1 
Finished Step #1 - "builder" 

请您参考如下方法:

python3-saml 包依赖于 xmlsec ,这实际上是导致此处构建失败的原因。 This package has pre-install dependencies on system-level libraries ,因此日志中有这条消息:

Could not find xmlsec1 config. Are libxmlsec1-dev and pkg-config installed?

无法在 AppEngine 标准环境中安装这些系统级包,相反您需要使用 a custom runtime with AppEngine Flex ,或使用不依赖于系统级包的 python3-saml 的替代品。