Flask - Elastic Beanstalk Deploy - requirements.txt non-zero exit status

大兔子大兔子 提交于 2021-02-08 05:50:10

问题


I'm able to run this web app locally that uses AWS for its db, but every deploy I end up getting the following error. I'm using Python 3 (3.4 per AWS requirements):

  2017-05-10 04:18:47,980 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1   Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    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 (Executor::NonZeroExitStatus)

Here's what my requirements.txt looks like, which includes a lot of packages that are dependent upon others:

appdirs==1.4.3
asn1crypto==0.22.0
cffi==1.10.0
click==6.7
cryptography==1.8.1
enum34==1.1.6
Flask==0.12.1
Flask-GoogleMaps==0.2.4
Flask-MySQL==1.4.0
idna==2.5
image==1.5.5
ipaddress==1.0.18
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
olefile==0.44
packaging==16.8
Pillow==4.1.1
pycparser==2.17
PyMySQL==0.7.11
pyOpenSSL==17.0.0
pyparsing==2.2.0
six==1.10.0
Werkzeug==0.12.1

回答1:


Somehow solved this by ensuring I had virtualenv -p python3 VENV and then adding an .ebextensions folder with a .config file containing:

packages:
    yum:
        libjpeg-turbo-devel: [] 

As was suggested here: https://stackoverflow.com/a/35168068/7982502



来源:https://stackoverflow.com/questions/43898577/flask-elastic-beanstalk-deploy-requirements-txt-non-zero-exit-status

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