Python论坛  - 讨论区

标题:[python-chinese] ��ڰ�װMySQL-python-1.2.0 ����

2007年03月12日 星期一 17:59

cry zyqmail在tom.com
星期一 三月 12 17:59:27 HKT 2007

kun xu,您好!

http://www.linuxforum.net/forum/showflat.php?Cat=&Board;=python&Number;=557837&page;=9&view;=collapsed&sb;=4&o;=&fpart;=

在 2007-03-12 17:41:00 您写道:
>我在RedHat ES3下安装MySQL-python-1.2.0,Python是2.5,但是一执行
>python setup.py build
>就报错,提示
>mysql.c:41:19: mysql.h: No such file or directory
>
>看了一下执行的语句,原来是这样:
>gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
>-fPIC -I/usr/local/include/python2.5 -c _mysql.c -o build/temp.linux-
>i686-2.5/_mysql.o -I'/usr/include/mysql'
>
>看到-I'/usr/include/mysql' 了么,带了单引号,导致编译不通过,如果去掉单引号,直接执行下列语句:
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
>-fPIC -I/usr/local/include/python2.5 -c _mysql.c -o build/temp.linux-
>i686-2.5/_mysql.o -I/usr/include/mysql
>
>编译OK,问题出来了,我看了看,是mysql的配置的问题,执行
>mysql_config
>
>显示如下:
>Usage: /usr/bin/mysql_config [OPTIONS]
>Options:
>        --cflags        [-I'/usr/include/mysql']
>        --libs          [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl
>-lm]
>        --socket        [/var/lib/mysql/mysql.sock]
>        --port          [3306]
>        --version       [3.23.58]
>
>
>各位兄弟,谁知道,mysql的这个编译参数在哪改呢?
>_______________________________________________
>python-chinese
>Post: send python-chinese在lists.python.cn
>Subscribe: send subscribe to python-chinese-request在lists.python.cn
>Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese

                    致
礼!

            cry
            zyqmail在tom.com



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年03月12日 星期一 18:29

kun xu coonxu在gmail.com
星期一 三月 12 18:29:23 HKT 2007

ÊÔÁËÄã˵µÄ£¬»¹ÊDz»ÐУ¬²ÎÊýÒÀȻûÓÐÈ¡¶Ô
È¡library_dirs Ö±½Ó±¨´í£¬Í¬Ê±Ô­À´½Å±¾ÖÐlibrariesµÄֵҲûÓÐÈ¡¶Ô£¬°Ñ']'Ҳȡ¹ýÀ´ÁË£º
libraries: ['mysqlclient', 'z', 'crypt', 'nsl', 'm]', 'mysqlclient_r']

×îºóÎÒÓÃÁËÒ»¸öºÜÍÁµÄ°ì·¨£¬Ö±½ÓÔÚ91£¬92Ðкó¶Ôinclude_dirs£¬ library_dirs£¬libraries
½øÐÐÁ˸³Öµ£¬Í¨ÓÃÐÔÊÇûÓÐÁË£¬±àÒëµ¹ÊÇͨ¹ýÁË¡£

include_dirs = ['/usr/include/mysql']
library_dirs = ['/usr/lib/mysql']
libraries = ['mysqlclient', 'z', 'crypt', 'nsl', 'm', 'mysqlclient_r']


ÔÚ07-3-12£¬cry <zyqmail在tom.com> дµÀ£º
>
> kun xu£¬ÄúºÃ£¡
>
>
> http://www.linuxforum.net/forum/showflat.php?Cat=&Board;=python&Number;=557837&page;=9&view;=collapsed&sb;=4&o;=&fpart;=
>
> ÔÚ 2007-03-12 17:41:00 ÄúдµÀ£º
> >ÎÒÔÚRedHat ES3Ï°²×°MySQL-python-1.2.0£¬PythonÊÇ2.5£¬µ«ÊÇÒ»Ö´ÐÐ
> >python setup.py build
> >¾Í±¨´í£¬Ìáʾ
> >mysql.c:41:19: mysql.h: No such file or directory
> >
> >¿´ÁËÒ»ÏÂÖ´ÐеÄÓï¾ä£¬Ô­À´ÊÇÕâÑù£º
> >gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
> -Wstrict-prototypes
> >-fPIC -I/usr/local/include/python2.5 -c _mysql.c -o build/temp.linux-
> >i686-2.5/_mysql.o -I'/usr/include/mysql'
> >
> >¿´µ½-I'/usr/include/mysql' ÁËô£¬´øÁ˵¥ÒýºÅ£¬µ¼Ö±àÒ벻ͨ¹ý£¬Èç¹ûÈ¥µôµ¥ÒýºÅ£¬Ö±½ÓÖ´ÐÐÏÂÁÐÓï¾ä£º
> > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
> -Wstrict-prototypes
> >-fPIC -I/usr/local/include/python2.5 -c _mysql.c -o build/temp.linux-
> >i686-2.5/_mysql.o -I/usr/include/mysql
> >
> >±àÒëOK£¬ÎÊÌâ³öÀ´ÁË£¬ÎÒ¿´ÁË¿´£¬ÊÇmysqlµÄÅäÖõÄÎÊÌ⣬ִÐÐ
> >mysql_config
> >
> >ÏÔʾÈçÏ£º
> >Usage: /usr/bin/mysql_config [OPTIONS]
> >Options:
> >        --cflags        [-I'/usr/include/mysql']
> >        --libs          [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt
> -lnsl
> >-lm]
> >        --socket        [/var/lib/mysql/mysql.sock]
> >        --port          [3306]
> >        --version       [3.23.58]
> >
> >
> >¸÷λÐֵܣ¬Ë­ÖªµÀ£¬mysqlµÄÕâ¸ö±àÒë²ÎÊýÔÚÄĸÄÄØ£¿
> >_______________________________________________
> >python-chinese
> >Post: send python-chinese在lists.python.cn
> >Subscribe: send subscribe to python-chinese-request在lists.python.cn
> >Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>                    ÖÂ
> Àñ£¡
>
>            cry
>            zyqmail在tom.com
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070312/a72dd37c/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号