python - Google Cloud Composer,无法安装 python-snappy

标签 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 error status code: 400 Http error message: BAD REQUEST Additional errors: {"ResourceType":"w071b50175ee0733c-tp/asia-northeast1-kumparan-co-e2ca75b3-gae-typer:appengine.apps.services.versions.create","ResourceErrorCode":"400","ResourceErrorMessage":"Docker image gcr.io/w071b50175ee0733c-tp/c949bad3-ca30-4717-a975-8e36bae3929a was either not found, or is not in Docker V2 format. Please visit https://cloud.google.com/container-registry/docs/ui "}

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

但是,就我而言,它并没有解决这个问题。

有人知道如何解决吗?

最佳答案

如果您导航至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 绑定(bind),而不是 C 库本身。

参见"Error installing python-snappy: snappy-c.h: No such file or directory"了解更多详情。

关于python - Google Cloud Composer,无法安装 python-snappy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54182517/

相关文章:

android - 使用 kivy 在 Android 和 IOS 中播放音频(mp3)

google-cloud-platform - Cloud Build 在阻塞在 Queued 的工作池中构建

python - 如果 numpy 中的轴中存在任何 nan,则将 nan 设置为整个轴

python - 区分本地导入和系统导入

kubernetes - 在Google Kubernetes引擎上进行垂直自动缩放?

google-cloud-platform - GCP数据流: print PCollection data

python - 云 Composer /Airflow : Relationships can only be set between Operators; received PythonOperator

jenkins - 在airflow中的特定时间运行任务

sql-server - Google Composer - 如何在环境中安装 Microsoft SQL Server ODBC 驱动程序

Python Pandas : Group BY function on categorical variables