Getting error while deploy django apps in aws elastic beanstalk

喜夏-厌秋 提交于 2020-04-11 12:14:03

问题


[Instance: i-*****************] 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.

i'm getting this error, can anyone give some picture of what and why it is coming.

And my requirements.txt is

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


回答1:


Your requirements.txt should look like this:

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

if you connect to your instance using

eb ssh

And then run

source /opt/python/run/venv/bin/activate
source /opt/python/current/env
pip install -r /opt/python/current/app/requirements.txt

You should get to see the errors.

Tom.



来源:https://stackoverflow.com/questions/47093737/getting-error-while-deploy-django-apps-in-aws-elastic-beanstalk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!