【发布时间】:2022-01-01 19:14:42
【问题描述】:
我对云服务非常陌生,目前正在从事一个个人项目,以在 Google App Engine 上部署聊天机器人网络应用程序。当我在 Cloud Shell 终端上运行命令 gcloud app deploy 时,我不断收到以下错误消息:
Step #1: ERROR: Could not find a version that satisfies the requirement Python==3.7.3 (from -r requirements.txt (line 3)) (from versions: none)
Step #1: ERROR: No matching distribution found for Python==3.7.3 (from -r requirements.txt (line 3))
Step #1: WARNING: You are using pip version 20.2.2; however, version 21.3.1 is available.
Step #1: You should consider upgrading via the '/env/bin/python -m pip install --upgrade pip' command.
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:xxxx" failed: step exited with non-zero status: 1
这是我的 requirements.txt 文件中的内容:
Flask==1.1.2
Werkzeug==1.0.1
Python==3.7.3
gunicorn==20.0.4
这就是我的 app.yaml 中的内容:
runtime: python
env: flex
runtime_config:
python_version: 3
api_version: 1
threadsafe: true
entrypoint: gunicorn -b :$PORT main:app
不知道这些错误是怎么回事,因为我已经尝试安装最新版本的 pip 和 Python 3.7.3。
【问题讨论】:
-
你不应该在
requirements.txt中提及python,它只是为了保留使用pip 安装的所有外部依赖项。因此,只需从需求文件中删除Python==3.7.3。