Google Cloud App Engine:Cloud Build 在 "python setup.py egg_info" 次失败



我正在尝试使用flask部署一个用python3.6编写的谷歌云应用引擎应用程序。

这是错误:

Step #1: Collecting pip==10.0.1 (from -r requirements.txt (line 1))
Step #1: Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
Step #1: Collecting Flask==0.12.2 (from -r requirements.txt (line 2))
Step #1: Downloading https://files.pythonhosted.org/packages/77/32/e3597cb19ffffe724ad4bf0beca4153419918e7fa4ba6a34b04ee4da3371/Flask-0.12.2-py2.py3-none-any.whl (83kB)
Step #1: Collecting gunicorn==19.7.1 (from -r requirements.txt (line 3))
Step #1: Downloading https://files.pythonhosted.org/packages/64/32/becbd4089a4c06f0f9f538a76e9fe0b19a08f010bcb47dcdbfbc640cdf7d/gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
Step #1: Collecting oauth2client==4.1.2 (from -r requirements.txt (line 4))
Step #1: Downloading https://files.pythonhosted.org/packages/82/d8/3eab58811282ac7271a081ba5c0d4b875ce786ca68ce43e2a62ade32e9a8/oauth2client-4.1.2-py2.py3-none-any.whl (99kB)
Step #1: Collecting google-cloud (from -r requirements.txt (line 5))
Step #1: Downloading https://files.pythonhosted.org/packages/49/9a/943f0e217990c37e119101bbb739d86201ec1fdf59152ecc2dba93c5a8ad/google-cloud-0.33.0.tar.gz
Step #1: Complete output from command python setup.py egg_info:
Step #1: Traceback (most recent call last):
Step #1: File "<string>", line 1, in <module>
Step #1: File "/tmp/pip-build-agnydxp0/google-cloud/setup.py", line 22, in <module>
Step #1: with open(os.path.join(PACKAGE_ROOT, 'setup-README.rst')) as file_obj:
Step #1: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-agnydxp0/google-cloud/setup-README.rst'
Step #1: 
Step #1: ----------------------------------------
Step #1: [91mCommand "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-agnydxp0/google-cloud/
Step #1: [0m[91mYou are using pip version 9.0.3, however version 10.0.1 is available.
Step #1: You should consider upgrading via the 'pip install --upgrade pip' command.[0m[91m
Step #1: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-builders/docker@sha256:2357779cf996af7c1538a7035ab26073274de0d03e9eaf156e33083f5a90280a" failed: exit status 1
Step #1: [0m

我搜索并发现错误是由于过时的pip版本而发生的。但是,我在我的要求中pip==10.0.1了.txt但它仍然不起作用。

有没有办法远程运行pip install --upgrade pip?如果是这样,我该怎么做?

编辑:

这是我的清单文件 app.yaml:

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10

我今天早些时候遇到了这个问题,我通过只安装我需要的谷歌云软件包(在我的情况下是google-cloud-pubsubgoogle-cloud-storage(来修复它。看起来伞形google-cloud包无论如何都已弃用。来源: https://pypi.org/project/google-cloud/

警告:谷歌云 Python 包已弃用。2018 年 6 月 18 日,此软件包将不再安装任何其他软件包。请安装您的应用程序所需的特定于产品的 google-cloud-* 软件包。

最新更新