错误“您的requirements.txt无效";在遵循教程AWS Elastic Beanstalk的Flask教程时 [英] Error "Your requirements.txt is invalid" when following tutorial AWS Elastic Beanstalk's Flask tutorial

查看:75
本文介绍了错误“您的requirements.txt无效";在遵循教程AWS Elastic Beanstalk的Flask教程时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注AWS Elastic Beanstalk的 Flask教程,以部署示例应用程序.

I'm following AWS Elastic Beanstalk's Flask tutorial to deploy the sample application.

尽管我收到错误消息您的requirements.txt无效-如下所示.我

Though I get error Your requirements.txt is invalid - in full as below. I google for this error though I get no helpful solution for me.

我的 requirements.txt 文件粘贴在以下部分中.我正在使用 Ubuntu Desktop 16.04

My requirements.txt file is pasted in below sections. And I'm using Ubuntu Desktop 16.04

由于您可能会按照本教程成功进行部署,请分享.谢谢.

As you may succeed the deployment following the tutorial, please share. Thank you.

ERROR: Your requirements.txt is invalid. Snapshot your logs for details.
ERROR: [Instance: i-c78c8f57] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
  File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
  CalledProcessError:
    Command
    '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt'
    returned non-zero exit status 1.
  Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed.
  For more detail, check /var/log/eb-activity.log using console or EB CLI.

INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
WARN: Environment health has transitioned from Pending to Degraded. Command failed on all instances. Initialization completed 45 seconds ago and took 3 minutes.
ERROR: Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.

requirements.txt

click==6.6
Flask==0.11.1
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
pkg-resources==0.0.0
Werkzeug==0.11.10

推荐答案

我在本地进行了测试,能够复制您的问题.为了获得有关实例出了什么问题的更多信息,我使用了 eb日志来查看EC2实例上当前的日志.由此,我可以在 eb-activity.log

I tested locally and was able to replicate your problem. To get more information about what went wrong on instance I used eb logs to view the logs currently on the EC2 instances. From that I was able to see the full stack in the eb-activity.log

 Collecting pkg-resources==0.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 4))
    Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 4)) (from versions: )
  No matching distribution found for pkg-resources==0.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 4))

我不确定 pkg-resources = 0.0.0 的来源,但它不是pip中的有效软件包.我能够删除该行并成功部署.

I'm not sure where the pkg-resources=0.0.0 came from but it's not a valid package in pip. I was able to delete that line and deploy successfully.

您可能想验证 pip Frozen 的输出,并查看该库是否确实存在.

You may want to verify the output of your pip freeze and see if that library is actually there.

这篇关于错误“您的requirements.txt无效";在遵循教程AWS Elastic Beanstalk的Flask教程时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆