我正在尝试将我的Django Elastic Beanstalk连接到我的RDS MySQL。我的Django通过localhost与我的RDS MySQL工作正常,但是当我尝试将我的Django上传到Elastic Beanstalk时,我得到了“部署应用程序失败”的错误,并且AWS显示了以下错误。我的项目在requirements.txt中有mysqlclient,就像这里所示:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-rds.html
根据该页面,这应该足够了。我当然尝试过搜索类似的问题,但迄今为止没有成功。我注意到许多问题都提到需要在.ebextensions文件夹中有一个packages.config文件,我尝试了其中许多建议,但没有成功。这是问题吗?为什么AWS页面上没有提到这一点?
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-r0dz9d2g/mysqlclient_f2b5c53e43a648c284b06f7af63d9855/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-r0dz9d2g/mysqlclient_f2b5c53e43a648c284b06f7af63d9855/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-r0dz9d2g/mysqlclient_f2b5c53e43a648c284b06f7af63d9855/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output] Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号