Python 在aws elastic beanstalk中部署django应用程序时出错

Python 在aws elastic beanstalk中部署django应用程序时出错,python,django,amazon-web-services,amazon-ec2,amazon-elastic-beanstalk,Python,Django,Amazon Web Services,Amazon Ec2,Amazon Elastic Beanstalk,[实例:i-***************]命令在实例上失败。返回代码:1输出:(截断)…文件“/usr/lib64/python2.7/subprocess.py”,第541行,在check_call raise CalledProcessError(retcode,cmd)CalledProcessError:Command'/opt/python/run/venv/bin/pip install-r/opt/python/ondeck/app/requirements.txt'返回非零退出

[实例:i-***************]命令在实例上失败。返回代码:1输出:(截断)…文件“/usr/lib64/python2.7/subprocess.py”,第541行,在check_call raise CalledProcessError(retcode,cmd)CalledProcessError:Command'/opt/python/run/venv/bin/pip install-r/opt/python/ondeck/app/requirements.txt'返回非零退出状态1。Hook/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py失败。有关更多详细信息,请使用console或eb CLI检查/var/log/eb-activity.log

我得到了这个错误,谁能给我一些关于它是什么以及为什么会发生的图片

我的requirements.txt是


Django==1.11.4,djangorestframework==3.5.1,psycopg2==2.7.3.1,gunicorn==19.7.0,Django-cors-headers==2.1.0,whitenoise==3.3.1,coreapi==2.3.1,sendgrid==5.2.0,awsebcli==3.5.1,pystan==2.17.0

您的requirements.txt应该是这样的:

Django==1.11.4
djangorestframework==3.5.1
psycopg2==2.7.3.1
gunicorn==19.7.0
django-cors-headers==2.1.0
whitenoise==3.3.1
coreapi==2.3.1
sendgrid==5.2.0
awsebcli==3.5.1
pystan==2.17.0.0
如果您使用

eb ssh
然后跑

source /opt/python/run/venv/bin/activate
source /opt/python/current/env
pip install -r /opt/python/current/app/requirements.txt
您应该可以看到错误


Tom。

损坏的意思?请参见上面与我的项目中相同的内容,但我是这样复制粘贴的。是否使用yum安装必要的prerequesite?在这里查看示例ebextensions文件:只有postgres正在使用yum进行安装。这是我的.config文件
container\u命令:01\u migrate:command:“python manage.py migrate”leader\u only:true 02\u collectstatic:command:“python manage.py collectstatic--noinput”选项\u设置:“aws:elasticbeanstalk:application:environment”:DJANGO\u设置\u模块:“pms\u backend.settings”PYTHONPATH:“$PYTHONPATH”“aws:elasticbeanstalk:container:python”:WSGIPath:“pms_backend/wsgi.py”包:yum:postgresql95-devel:[]