Google App Engine部署失败,因为在工作区中找不到requirements.txt文件

da4l

是否有人收到“步骤#1-“构建器”:IOError:[Errno 2]此类文件或目录:尝试部署时没有这样的文件或目录:“ /workspace/requirements.txt -t lib /'以安装这些依赖项\ r”'错误将python37应用添加到Google App Engine?

我正在尝试使用python 37标准运行时部署我的Web应用程序,并收到以下构建错误:

Step #1 - "builder": IOError: [Errno 2] No such file or directory: "/workspace/requirements.txt -t lib/' to install these dependencies\r"
Finished Step #1 - "builder"
ERROR

我已经仔细检查了requirements.txt文件与main.py脚本位于同一目录中,并且似乎根据日志中的内容在部署中读取了requirements.txt文件,但随后找不到工作区中的文件。

我正在从虚拟环境中进行部署,并确保在虚拟环境中运行“ pip install -r requirements.txt”命令,但是在部署时它在日志中仍会给出相同的错误。以下是app.yaml文件内容的副本和部分日志。

app.yaml文件

runtime: python37

instance_class: B8
basic_scaling:
   max_instances: 1
   idle_timeout: 1m

handlers:
 - url: /.*
   script: auto

日志:

Step #1 - "builder": # This requirements file lists all third-party 
dependencies for this project.
Step #1 - "builder": #
Step #1 - "builder": # Run 'pip install -r requirements.txt -t lib/' to     
install these dependencies
Step #1 - "builder": # in `lib/` subdirectory.
Step #1 - "builder": #
Step #1 - "builder": # Note: The `lib` directory is added to `sys.path` by `appengine_config.py`.
Step #1 - "builder": flask==1.0.2
Step #1 - "builder": flask-restful==0.3.6
Step #1 - "builder": firebase-admin==2.14.0
Step #1 - "builder": pandas==0.23.4
Step #1 - "builder": datetime==4.3
Step #1 - "builder": google.auth==1.6.2
Step #1 - "builder": google.cloud==0.34.0
Step #1 - "builder": google-cloud-pubsub==0.39.0
Step #1 - "builder": dfply==0.3.3
Step #1 - "builder": requests==2.21.0
Step #1 - "builder": gunicorn
Step #1 - "builder": 
Step #1 - "builder": INFO found recursive python requirements file: requirements.txt -t lib/' to install these dependencies
Step #1 - "builder": INFO checking_cached_requirements.txt_layer took 0 seconds
Step #1 - "builder": INFO build process for FTL image took 0 seconds
Step #1 - "builder": INFO full build took 0 seconds
Step #1 - "builder": Traceback (most recent call last):
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
Step #1 - "builder": "__main__", fname, loader, pkg_name)
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Step #1 - "builder": exec code in run_globals
Step #1 - "builder": File "/ftl.par/__main__.py", line 65, in <module>
Step #1 - "builder": File "/ftl.par/__main__.py", line 54, in main
Step #1 - "builder": File "/ftl.par/__main__/ftl/python/builder.py", line 114, in Build
Step #1 - "builder": File "/ftl.par/__main__/ftl/python/layer_builder.py", line 116, in BuildLayer
Step #1 - "builder": File "/ftl.par/__main__/ftl/common/single_layer_image.py", line 60, in GetCacheKey
Step #1 - "builder": File "/ftl.par/__main__/ftl/python/layer_builder.py", line 107, in GetCacheKeyRaw
Step #1 - "builder": File "/ftl.par/__main__/ftl/common/ftl_util.py", line 168, in descriptor_parser
Step #1 - "builder": File "/ftl.par/__main__/ftl/common/context.py", line 80, in GetFile
Step #1 - "builder": IOError: [Errno 2] No such file or directory: "/workspace/requirements.txt -t lib/' to install these dependencies\r"
Finished Step #1 - "builder"
ERROR
da4l

我花了一些时间才弄清楚,但之所以无法在工作区中找到requirements.txt文件的原因是由于注释掉了.txt文件中的标头,但是当然这不是python脚本,因此注释阻止了文件的正确读取。

我删除所有注释并仅保留软件包名称后,它便正确部署了。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Google App Engine部署失败。找不到pywin32 == xxx的匹配分布

在Google App Engine中上传文件

Google App Engine在Go运行时中找不到文件

使用Go在Google App Engine中读取本地文件

部署到Google App Engine

Blobstore中的非ASCII文件名(Google App Engine)

如何从Google App Engine读取Google Cloud Storage文件

部署Google App Engine失败,超时

Google App Engine部署问题-找不到主应用

Google App Engine,提供静态文件

如何使用python 3.5在Google App Engine中打开文件?

App Engine Google Cloud中的部署失败

在cloudshell(Google App Engine)中寻找已部署的应用程序文件的位置?

Google App Engine-找不到PHP App图片/ CSS

Google App Engine上传失败

从Google App Engine下载多个csv文件

使用JPA + Google App Engine:在CLASSPATH中找不到META-INF / persistence.xml文件

静态文件在Google App Engine中位于哪里?

Google App Engine中的Spring OAuth失败

Google App Engine的Cron作业日志文件

上载一个小的.txt文件并在Java Google App Engine中读取其行

Google App Engine + Django +文件传输失败

下载 Google App Engine Blobstore 中的所有文件

在 Google App Engine 上找不到以下文件:/_ah/start

如何在 Google Cloud Platform、App Engine 中执行 pip install -r requirements.txt(不使用 Gitlab CI)?

使用 Google Cloud Build 部署到 Google App Engine 时,依赖项 (requirements.txt) 未正确安装

Google App Engine - 使用相同的 app.yaml 部署不同的文件夹

在 Google Colab 中合并多个 .txt 文件

Google Cloud App Engine 部署失败 (Django)