Python AWS Elastic Beanstalk:部署Django应用程序失败

Python AWS Elastic Beanstalk:部署Django应用程序失败,python,django,amazon-web-services,Python,Django,Amazon Web Services,我一直在尝试在EB上部署react应用程序的Django后端,但在尝试部署时可能会遇到错误。我不确定如何从日志中获取更多详细信息,但我还附加了错误结果下方的by requirements.txt文件 2020-11-22 23:44:27 ERROR Your requirements.txt is invalid. Snapshot your logs for details. 2020-11-22 23:44:30 ERROR [Instance: i-0da4be908

我一直在尝试在EB上部署react应用程序的Django后端,但在尝试部署时可能会遇到错误。我不确定如何从日志中获取更多详细信息,但我还附加了错误结果下方的by requirements.txt文件

2020-11-22 23:44:27    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2020-11-22 23:44:30    ERROR   [Instance: i-0da4be9088c225a28] 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. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2020-11-22 23:44:31    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-11-22 23:45:33    ERROR   Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.

asgiref==3.3.1
attrs==20.3.0
awsebcli==3.19.2
bcrypt==3.2.0
blessed==1.17.11
boto3==1.16.23
botocore==1.19.23
cached-property==1.5.2
cement==2.8.2
certifi==2020.11.8
cffi==1.14.3
chardet==3.0.4
colorama==0.4.3
cryptography==3.2.1
Django==3.1.3
django-cors-headers==3.5.0
django-environ==0.4.5
django-storages==1.10.1
djangorestframework==3.12.2
docker==4.3.1
docker-compose==1.25.5
dockerpty==0.4.1
docopt==0.6.2
environ==1.0
future==0.16.0
idna==2.10
jmespath==0.10.0
jsonschema==3.2.0
mysql-connector-python==2.0.4
mysqlclient==2.0.1
paramiko==2.7.2
pathspec==0.5.9
Pillow==8.0.1
pycparser==2.20
PyMySQL==0.10.1
PyNaCl==1.4.0
pyrsistent==0.17.3
python-dateutil==2.8.1
pytz==2020.4
PyYAML==5.3.1
requests==2.24.0
s3transfer==0.3.3
semantic-version==2.5.0
six==1.15.0
sqlparse==0.4.1
termcolor==1.1.0
texttable==1.6.3
urllib3==1.25.11
wcwidth==0.1.9
websocket-client==0.57.0


2020/11/23 01:37:31.395091 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 1. Stderr:ERROR: Could not find a version that satisfies the requirement mysql-connector-python==2.0.4 (from -r requirements.txt (line 29)) (from versions: 8.0.5, 8.0.6, 8.0.11, 8.0.12, 8.0.13, 8.0.14, 8.0.15, 8.0.16, 8.0.17, 8.0.18, 8.0.19, 8.0.20, 8.0.21, 8.0.22)

错误:未找到mysql连接器python==2.0.4(来自-r requirements.txt(第29行))

如果您使用ssh连接到EB实例,是否可以手动运行
requirements.txt
以检查其是否按预期工作?@Marcin Yep,我得到了更多信息,因此(mysql连接器python==2.0.4)似乎有问题。以下是日志:在执行命令[app deploy]时出错-找不到满足mysql连接器python==2.0.4要求的版本(来自-r requirements.txt(第29行))(来自版本:8.0.5、8.0.6、8.0.11、8.0.12、8.0.13、8.0.14、8.0.15、8.0.16、8.0.17、8.18、8.0.19、8.0.20、8.0.21、8.0.22)错误:未找到mysql连接器python==2.0.4(来自-r requirements.txt(第29行))的匹配发行版。您是否将其更改为使用现有版本?@Marcin是的,我仍然遇到有关mysqlclient的错误。环境找不到sql_config文件,请在.ebextensions文件夹中添加必要的包。我还检查了其他帖子和非修复错误的帖子。/bin/sh:mysql\u-config:command-not-found/bin/sh:mariadb\u-config:command-not-found/bin/sh:mysql\u-config:command-not-found-Traceback(最近一次调用):文件“”,第1行,文件“/tmp/pip-install-psb7a445/mysqlclient/setup.py”,第15行,在元数据中,options=get_config()File“/tmp/pip-install-psb7a445/mysqlclient/setup_posix.py”,第65行,在get_config libs=mysql_config(“libs”)中,如果您通过ssh连接到EB实例中,您可以手动运行您的
requirements.txt
来检查它是否按预期工作吗?@Marcin yes,我得到了更多信息,因此它似乎有问题(mysql连接器python==2.0.4)。以下是日志:在执行命令[app deploy]期间发生错误-找不到满足要求的版本mysql连接器python==2.0.4(来自-r requirements.txt(第29行))(来自版本:8.0.5、8.0.6、8.0.11、8.0.12、8.0.13、8.0.14、8.0.15、8.0.16、8.0.17、8.0.18、8.0.19、8.0.20、8.0.21、8.0.22)错误:未找到mysql连接器python==2.0.4的匹配分布(来自-r requirements.txt(第29行))您是否将其更改为使用现有版本?@Marcin是的,我仍然遇到有关mysqlclient的错误。环境找不到sql_配置文件,请阻止我在.ebextensions文件夹中添加必要的包。我还检查了其他帖子和未修复错误的帖子。/bin/sh:mysql_-config:command not found/bin/sh:mariadb_config:command not found/bin/sh:mysql_config:command not found Traceback(最近一次调用):文件“”,第1行,在文件“/tmp/pip-install-psb7a445/mysqlclient/setup.py”中,第15行,在元数据中,options=get_config()文件“/tmp/pip-install-psb7a445/mysqlclient/setup\posix.py”,第65行,在get_config libs=mysql_config(“libs”)中