【问题标题】:Elastic Beanstalk with python 3.4 still using python 2.7带有 python 3.4 的 Elastic Beanstalk 仍在使用 python 2.7
【发布时间】:2018-03-18 20:56:45
【问题描述】:

我只是使用带有 python 3.4 和 Django 的 EB 启动了一些环境,但它一直失败,看起来使用 pip install -r requirements.txt 安装时发生错误这是来自 Web 控制台的事件:

Time    Type    Details
2017-10-06 20:22:39 UTC-0600    WARN    Environment health has transitioned from Pending to Degraded. Command failed on all instances. Initialization completed 69 seconds ago and took 14 minutes.
2017-10-06 20:22:20 UTC-0600    ERROR   Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
2017-10-06 20:21:17 UTC-0600    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2017-10-06 20:21:17 UTC-0600    ERROR   [Instance: i-0b46caf0e3099458c] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) File "/usr/lib64/python2.7/subprocess.py", line 541, 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.
2017-10-06 20:21:14 UTC-0600    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.

我按照本教程进行操作:django-elastic-beanstalk-djangodeploying-a-django-app-and-postgresql-to-aws-elastic-beanstalk 我都卡在同一步骤

【问题讨论】:

  • 使用支持 Python 3 的最新 AMI 2017-09
  • 如何在 Eb 中使用 AMI?
  • 找到您要使用的 AMI ID。然后在 EB 中将默认的 AMI ID 替换为您想要的。
  • 有人能写出更完整的说明吗?比如去控制台找到一个我已经拥有的实例然后使用那个 AMI?我可以通过 EC2 控制台找到我的实例的 AMI ID,但它的 ID 中有python34。我在部署时尝试使用python2.7 时遇到了同样的错误...

标签: python django amazon-web-services amazon-elastic-beanstalk


【解决方案1】:

我遇到了完全相同的问题。这是我找到的解决方案:

  1. 转到到您的环境的配置
  2. 点击Instances的conf按钮
  3. Server 部分下,检查您的 Custom AMI ID

现在,离开页面并转到AWS EC2 Console page

  1. 启动实例
  2. 您现在将进入第 1 步:选择 Amazon 系统映像 (AMI)
  3. 多田!您将看到这些可供选择的 ami id:

  4. 返回no.3并填写自定义AMI ID,参考no.6 (仅供参考,我使用的是 amazon linux,但由您决定)

  5. 点击应用并等待配置完成
  6. 重新关注部署django应用
  7. 完成!

【讨论】:

    猜你喜欢
    • 2015-08-02
    • 2015-03-13
    • 2012-10-13
    • 1970-01-01
    • 2019-01-02
    • 1970-01-01
    • 1970-01-01
    • 2015-06-15
    • 2014-09-13
    相关资源
    最近更新 更多