Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python3.4的Elastic Beanstalk仍在使用Python2.7_Python_Django_Amazon Web Services_Amazon Elastic Beanstalk - Fatal编程技术网

使用Python3.4的Elastic Beanstalk仍在使用Python2.7

使用Python3.4的Elastic Beanstalk仍在使用Python2.7,python,django,amazon-web-services,amazon-elastic-beanstalk,Python,Django,Amazon Web Services,Amazon Elastic Beanstalk,我刚刚使用EB和Python3.4和Django启动了一些环境,但它一直失败,似乎在使用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 insta

我刚刚使用EB和Python3.4和Django启动了一些环境,但它一直失败,似乎在使用
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.

我遵循了本教程:在这两个方面,我都被困在同一个步骤上,我遇到了完全相同的问题。以下是我找到的解决方案:

  • 转到您环境的配置
  • 点击实例的conf按钮
  • 在服务器部分下,检查您的自定义AMI ID
  • 现在,离开页面,转到

  • 启动实例
  • 现在您将进入步骤1:选择亚马逊机器映像(AMI)
  • 塔达!您将看到这些ami ID,您可以从中选择:

  • 返回第3号并填写自定义AMI ID,参考第6号 (仅供参考,我使用了amazon linux,但这取决于您的决定)

  • 单击应用,等待配置完成
  • 重新关注部署django应用程序
  • 完成

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