Google Cloud Composer,无法安装python-snappy

时间:2019-01-14 13:31:44

标签: python google-cloud-platform google-cloud-composer

我正在尝试通过Google Cloud Platform控制台在Google Cloud Composer中安装python-snappy。我正在使用python3环境。

我曾尝试安装不同的python-snappy版本(0.5.3、0.5.2、0.5.1、0.5、0.4),但是,它总是会引发此错误:

  

Http错误状态码:400 Http错误消息:BAD REQUEST其他   错误:   {“ ResourceType”:“ w071b50175ee0733c-tp / asia-northeast1-kumparan-co-e2ca75b3-gae-typer:appengine.apps.services.versions.create”,“ ResourceErrorCode”:“ 400”,“ ResourceErrorMessage”:“ Docker   图片gcr.io/w071b50175ee0733c-tp/c949bad3-ca30-4717-a975-8e36bae3929a   找不到,或者不是Docker V2格式。请拜访   https://cloud.google.com/container-registry/docs/ui“}

我还尝试过重新运行,如此处所述:https://groups.google.com/forum/#!topic/cloud-composer-discuss/jpxAGCPFkZo

但是,就我而言,这不能解决这个问题。

任何人都知道如何解决吗?

1 个答案:

答案 0 :(得分:2)

如果导航到https://console.cloud.google.com/cloud-build/builds/,则应该看到带有以下日志的构建失败:

Failed building wheel for python-snappy
Running setup.py clean for python-snappy
Failed to build python-snappy
Installing collected packages: python-snappy
Running setup.py install for python-snappy: started
Running setup.py install for python-snappy: finished with status 'error'
Complete output from command /usr/local/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-M5s4qk/python-snappy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-EuqCf8/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/snappy
copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/__main__.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/snappy_formats.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/snappy.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-2.7/snappy
copying snappy/__init__.py -> build/lib.linux-x86_64-2.7/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/snappy
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c snappy/snappymodule.cc -o build/temp.linux-x86_64-2.7/snappy/snappymodule.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
snappy/snappymodule.cc:31:22: fatal error: snappy-c.h: No such file or directory
#include <snappy-c.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1

这是因为python-snappy包只是对基础C库的Python绑定,而不是C库本身。

有关更多详细信息,请参见"Error installing python-snappy: snappy-c.h: No such file or directory"