Django应用程序无法通过'firebase-admin'库在AWS ElasticBeanstalk上部署

问题描述 投票:0回答:1

我正在将python / django应用程序部署到aws elasticbeanstalk。如果我未在requirements.txt中指定“ firebase-admin”库,它将得到很好的部署。但是无论我在request.txt中添加哪个版本,如果添加“ firebase-admin”,部署都会失败,如下所示:enter image description here

这是我的要求。txt:

Django==3.0.1
djangorestframework==3.11.0
psycopg2==2.7.3.1
django-cors-headers==3.2.0
pytz==2017.2
tinys3==0.1.12
apiclient==1.0.3
drf_yasg==1.17.1
google-api-python-client==1.7.3
google-auth==1.5.0
google-auth-httplib2==0.0.3
httplib2==0.11.3
django-rest-auth==0.9.5
oauth2client==4.1.2
geographiclib==1.50
geopy==1.20.0
numpy==1.15.2
pyyaml==5.3.1

和AWS elasticbeanstalk python实例详细信息:在64位Amazon Linux / 2.9.7上运行的Python 3.6

请帮助。谢谢

UPDATE:以下requirements.txt在localhost虚拟环境中可以正常工作:

Django==3.0.1
djangorestframework==3.11.0
psycopg2==2.7.3.1
django-cors-headers==3.2.0
pytz==2017.2
tinys3==0.1.12
apiclient==1.0.3
drf_yasg==1.17.1
google-api-python-client==1.7.8
google-auth==1.14.0
google-auth-httplib2==0.0.3
httplib2==0.11.3
django-rest-auth==0.9.5
oauth2client==4.1.2
geopy==1.20.0
pyyaml==5.3.1
firebase-admin==2.13.0

但是在部署到AWS时却出现以下错误:

ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2020-04-22 00:14:47    ERROR   [Instance: i-0864d69c58c343870] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
  File "/usr/lib64/python2.7/subprocess.py", line 190, 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. 
python django firebase amazon-elastic-beanstalk firebase-admin
1个回答
0
投票

我在本地尝试了您的requirements.txt文件,这导致了以下错误。

ERROR: google-api-core 1.17.0 has requirement google-auth<2.0dev,>=1.14.0, but you'll have google-auth 1.5.0 which is incompatible.
ERROR: google-cloud-storage 1.27.0 has requirement google-auth<2.0dev,>=1.11.0, but you'll have google-auth 1.5.0 which is incompatible.
ERROR: firebase-admin 4.0.0 has requirement google-api-python-client>=1.7.8, but you'll have google-api-python-client 1.7.3 which is incompatible.

这也很可能在您的部署环境中发生了,除了它没有记录错误。尝试解决以上依赖性冲突,然后重试。

© www.soinside.com 2019 - 2024. All rights reserved.