问题描述
我正在 AWS Elastic Beanstalk 上部署带有 mysql 应用程序的 django,因此需要 mysqlclient
库.mysqlclient
需要安装 python3-devel
和 mysql-devel
包,所以我有它的自定义配置文件 01_packages.config:
I am deploying a django with mysql app on AWS Elastic Beanstalk, so mysqlclient
library is needed. mysqlclient
needs python3-devel
and mysql-devel
package to be installed, so I have the custom config file for it 01_packages.config
:
部署失败,日志文件 /var/log/cfn-init.log
(在 Beanstalk 日志中提到)显示错误:
Deployment fails and the log file /var/log/cfn-init.log
(mentioned in Beanstalk logs) shows the error:
但是,我尝试通过 yum install mysql-devel
在我的 Ec2 实例上手动安装它并成功安装.
However, I tried to install it manually on my Ec2 instance through yum install mysql-devel
and it is installed successfully.
我的python版本是3.7,我的requirements.txt
文件内容是:
My python version is 3.7 and my requirements.txt
file content is:
推荐答案
已解决! 我已经将 mysql-devel
替换为 mariadb-devel
它运行成功,然后我就可以安装 mysqlcient
库.
Solved! I have replaced mysql-devel
with mariadb-devel
and it worked successfully, then I was able to install mysqlcient
library.
我的新01_packages.config
:
我不知道它的根本原因,但我这样做是因为我注意到通过 yum install mysql-devel
手动安装 mysql-devel
是实际安装mariadb-devel
!
I don't know the root cause of it, but I did so as I noticed that the manual installation of mysql-devel
through yum install mysql-devel
is actually installing mariadb-devel
!
这是我的 ec2 实例发布详细信息.也许是因为新的 Amazon Linux Release 2.
Here is my ec2 instance release details. Maybe it is because of the new Amazon Linux Release 2.
这篇关于AWS Elastic Beanstalk 中的 mysqlclient 安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!