Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
安装MySQL_python 1.2.2(Mac OS 10.6 Snow Leopard)时发生GCC错误_Python_Mysql_Gcc_Mysql Python - Fatal编程技术网

安装MySQL_python 1.2.2(Mac OS 10.6 Snow Leopard)时发生GCC错误

安装MySQL_python 1.2.2(Mac OS 10.6 Snow Leopard)时发生GCC错误,python,mysql,gcc,mysql-python,Python,Mysql,Gcc,Mysql Python,我正试图在雪豹上安装MySQL_python 1.2.2(我特别需要这个版本,而不是当前的1.2.3),下面是这个错误 要安装的命令: pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download 以及跟踪的一部分: copying MySQLdb/constants/CLIENT.py -> build/li

我正试图在雪豹上安装MySQL_python 1.2.2(我特别需要这个版本,而不是当前的1.2.3),下面是这个错误

要安装的命令:

pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download
以及跟踪的一部分:

copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-universal-2.6/MySQLdb/constants

running build_ext

building '_mysql' extension

creating build/temp.macosx-10.6-universal-2.6

/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,2,'final',0) - D__version__=1.2.2 -I/usr/local/mysql/include - I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o    build/temp.macosx-10.6-universal-2.6/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL

In file included from _mysql.c:35:

/usr/local/mysql/include/my_config.h:1053:1: warning: "HAVE_WCSCOLL" redefined

In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:8,

             from pymemcompat.h:10,

             from _mysql.c:29:

/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h:803:1: warning: this is the location of the previous definition

In file included from /usr/local/mysql/include/mysql.h:47,

             from _mysql.c:40:

/usr/include/sys/types.h:92: error: duplicate ‘unsigned’

/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers

error: command '/usr/bin/gcc-4.2' failed with exit status 1

以前有人见过这个错误吗?

正如错误所说,事情已经被重新定义了。过去,我通过注释正在构建的库的源代码中有问题的声明来解决这个问题。然而,这个解决方案有一些明显的问题…

正如错误所说,事情已经被重新定义了。过去,我通过注释正在构建的库的源代码中有问题的声明来解决这个问题。然而,这种解决方案存在一些明显的问题…

快速的谷歌搜索产生了:

为了让mysqldb在leopard上工作,我发现我必须编辑_mysql.c并编辑掉以下行:

#ifndef uint
#define uint unsigned int
#endif     
我还必须编辑site.cfg并将threadsafe标记为False

完成这项工作后,我成功地安装了MySQLdb,太棒了!并非如此 很快,还有另一个问题:

引用自:…/\u mysql.so原因:未找到图像

解决方案:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

谷歌快速搜索结果如下:

为了让mysqldb在leopard上工作,我发现我必须编辑_mysql.c并编辑掉以下行:

#ifndef uint
#define uint unsigned int
#endif     
我还必须编辑site.cfg并将threadsafe标记为False

完成这项工作后,我成功地安装了MySQLdb,太棒了!并非如此 很快,还有另一个问题:

引用自:…/\u mysql.so原因:未找到图像

解决方案:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

对于未来的搜索者,我只需要从这个链接中迈出第一步(在_mysql.so中注释掉三行),实际上没有必要这样做。只需安装python dev和libmysqlclient,然后pip安装MySQL python。@shakabra:你没有阅读问题的第一句话,是吗?对于未来的搜索者,我只需要从这个链接开始第一步(在_MySQL.so中注释掉三行)。实际上没有必要这样做。只需安装python dev和libmysqlclient,然后安装pip-MySQL-python。@shakabra:你没有读问题的第一句话,是吗?