0

我只是旋转了一些使用Python与Python 3.4和Django的环境,但它保持失败,看起来像使用pip install -r requirements.txt安装时发生的错误这是来自Web控制台的事件:Elastic Beanstalk与Python 3.4仍然使用python 2.7

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我被困在同一工序

+0

使用最新的AMI 2017-09支持Python 3 –

+0

如何在Eb中使用AMI? –

+0

找到您想要使用的AMI ID。然后在EB中将默认的AMI ID替换为所需的AMI ID。 –

回答

0

我有一个完全相同的问题。这里是我找到了解决办法:

  1. 转到您env的配置
  2. 点击实例
  3. CONF键在服务器部分,请检查您定制AMI ID

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

  • 启动实例
  • 现在,您将在第1步:选择一个亚马逊机器映像(AMI)
  • Tada!你会看到这些AMI的ID,你可以选择: AMI-IDs

  • 回去三号和填补自定义AMI ID,从6号指 (仅供参考,我使用亚马逊的Linux,但它是由你来决定)

  • 点击应用,等到完成配置后
  • 再按照部署Django应用程序
  • 完成!