安装MySQL_python 1.2.2当GCC错误(的Mac OS 10.6雪豹)(GCC err

2019-11-05 03:45发布

我试图安装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

有没有人见过这个错误之前?

Answer 1:

快速谷歌搜索产生了这样的回答 :

为了得到MySQLdb的上豹纹的工作,我发现我不得不编辑_mysql.c和编辑了线:

 #ifndef uint #define uint unsigned int #endif 

我也不得不编辑site.cfg和标记线程为False。

这样做后,我设法得到MySQLdb的安装,太棒了! 没有这么快,出现了另一个问题:

... / _ mysql.so原因:从引用图片未找到

解决方案:

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


Answer 2:

正如错误说,事情已经重新定义。 我在图书馆之中构建的源注释掉违规的申报解决此得到了过去。 但是,这种解决方案有一些明显的问题...



文章来源: GCC error when installing MySQL_python 1.2.2 (Mac OS 10.6 Snow Leopard)