我能够在本地运行这个使用AWS作为其数据库的Web应用程序,但每次部署我最终都会收到以下错误。我使用的是Python 3(每个AWS要求3.4个):
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)
这是我的requirements.txt的样子,其中包括很多依赖他人的包:
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
答案 0 :(得分:1)
通过确保我有virtualenv -p python3 VENV
然后添加.ebextensions文件夹以及包含以下内容的.config文件来解决这个问题:
packages:
yum:
libjpeg-turbo-devel: []