执行:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ mysql-python
错误信息:
_mysql.c:44:10: fatal error: my_config.h: 没有那个文件或目录
44 | #include "my_config.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
_mysql.c:44:10: fatal error: my_config.h: 没有那个文件或目录
44 | #include "my_config.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
解决方法:
87 sudo apt-get update
88 sudo apt-get install mysql-server
89 sudo apt-get install libmysqlclient-dev
在安装:安装 _MySQL-python-1.2.5.zip mysql.c:44:10: fatal error: my_config.h: No such file or directory
sudo wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -P /usr/include/mysql/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ mysql-python
再次执行:
成功: