【发布时间】:2020-06-08 08:56:15
【问题描述】:
我正在尝试在 python2 环境中安装 Mysqldb 并尝试了以下操作。
这就是最初的错误:
#include "my_config.h"
^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
然后我尝试了这些
sudo apt-get install python-mysqldb
sudo apt-get install python-pip python-dev libmysqlclient-dev
sudo apt-get install libssl-dev
错误没有变化
然后我尝试了这个
sudo apt install default-libmysqlclient-dev
现在的错误是
In file included from _mysql.c:44:
/usr/include/mariadb/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
#warning This file should not be included by clients, include only <mysql.h>
^~~~~~~
In file included from _mysql.c:46:
/usr/include/mariadb/mysql.h:444:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
MYSQL_CLIENT_PLUGIN_HEADER
^~~~~~~~~~~~~~~~~~~~~~~~~~
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
if ( reconnect != -1 ) self->connection.reconnect = reconnect;
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
有人可以帮助在 python2 virtualenv 中设置 mysqldb 吗?
【问题讨论】:
标签: python mysql linux mysql-python