我也遇到过同样的问题,它涉及到一些MariaDB包正在使用,但它们与MySQL native并不完全相同。
我仍然没有找到安装这个包的解决方案,但是我找到了一个可以满足我需要的解决方案,我在需求文件中将MySQL-python替换为MySQL-connector-python。
或者直接安装在你的Dockerfile中;
RUN pip install mysql-connector-python
然后根据MySQL文档建立我的连接
https://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html