首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装MySQL-Python

问无法安装MySQL-Python
EN

Stack Overflow用户
提问于 2011-06-02 22:37:07
回答 2查看 1.9K关注 0票数 2

由于某些原因,我既无法在我的virtualenv中安装MySQL-Python包,也无法在OS X上的Python主安装中安装MySQL-Python包。

代码语言:javascript
复制
    Downloading/unpacking MySQL-Python
    Running setup.py egg_info for package MySQL-Python
    warning: no files found matching 'MANIFEST'
    warning: no files found matching 'ChangeLog'
    warning: no files found matching 'GPL'
    Installing collected packages: MySQL-Python
    Running setup.py install for MySQL-Python
    building '_mysql' extension
    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/5.5.10/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
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:39:1: warning: this is the location of the previous definition
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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 _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:619:1: warning: "SIZEOF_TIME_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:40:1: warning: this is the location of the previous definition
    /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
    Installed assemblers are:
    /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
    /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:39:1: warning: this is the location of the previous definition
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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 _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:619:1: warning: "SIZEOF_TIME_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:40:1: warning: this is the location of the previous definition
    _mysql.c:2888: fatal error: error writing to -: Broken pipe
    compilation terminated.
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:9,
                     from pymemcompat.h:10,
                     from _mysql.c:29:
    /System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pymacconfig.h:33:1: warning: this is the location of the previous definition
    In file included from _mysql.c:36:
    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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
    lipo: can't open input file: /var/folders/8O/8OOqsN1GEkSD0wcAjZFbMk+++TI/-Tmp-//cc0nabTS.out (No such file or directory)
    error: command 'gcc-4.2' failed with exit status 1
    Complete output from command /Users/jmalina/Sites/virtualenvs/muckrack/bin/python -c "import setuptools;__file__='/Users/jmalina/Sites/virtualenvs/muckrack/build/MySQL-Python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/8O/8OOqsN1GEkSD0wcAjZFbMk+++TI/-Tmp-/pip-92IOBF-record/install-record.txt --install-headers /Users/jmalina/Sites/virtualenvs/muckrack/bin/../include/site/python2.6:
    running install

    running build

    running build_py

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

    running build_ext

    building '_mysql' extension

    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/Cellar/mysql/5.5.10/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

    In file included from _mysql.c:36:

    /usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined

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

                 from pymemcompat.h:10,

                 from _mysql.c:29:

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

    In file included from _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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 _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:619:1: warning: "SIZEOF_TIME_T" redefined

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

                 from pymemcompat.h:10,

                 from _mysql.c:29:

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

    /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed

    Installed assemblers are:

    /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64

    /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

    In file included from _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined

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

                 from pymemcompat.h:10,

                 from _mysql.c:29:

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

    In file included from _mysql.c:36: /usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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 _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:619:1: warning: "SIZEOF_TIME_T" redefined

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

                 from pymemcompat.h:10,

                 from _mysql.c:29:

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

    _mysql.c:2888: fatal error: error writing to -: Broken pipe

compilation terminated.

    In file included from _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:326:1: warning: "SIZEOF_SIZE_T" redefined

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

                 from pymemcompat.h:10,

                 from _mysql.c:29:

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

    In file included from _mysql.c:36:

/usr/local/Cellar/mysql/5.5.10/include/my_config.h:419: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

    lipo: can't open input file: /var/folders/8O/8OOqsN1GEkSD0wcAjZFbMk+++TI/-Tmp-//cc0nabTS.out (No such file or directory)

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

    ----------------------------------------
    Command /Users/jmalina/Sites/virtualenvs/muckrack/bin/python -c "import setuptools;__file__='/Users/jmalina/Sites/virtualenvs/muckrack/build/MySQL-Python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /var/folders/8O/8OOqsN1GEkSD0wcAjZFbMk+++TI/-Tmp-/pip-92IOBF-record/install-record.txt --install-headers /Users/jmalina/Sites/virtualenvs/muckrack/bin/../include/site/python2.6 failed with error code 1
EN

回答 2

Stack Overflow用户

发布于 2011-09-18 08:21:34

看起来你已经安装了MySQL 5.5.10和Python2.6。从MySQL-3.23到5.0都支持MySQL-python的当前版本(版本1.2.3)。但是,您可以尝试通过ActivePython安装它。

如果将ActivePython安装到默认路径,请打开终端并运行:

代码语言:javascript
复制
/opt/ActivePython-2.6/bin/pypm install mysql-python

我在我的Fedora15平台上用Python5.5和MySQL 2.7也遇到了类似的情况,它对我来说工作得很好。

票数 3
EN

Stack Overflow用户

发布于 2011-08-10 03:13:18

尝试重新下载整个包,并确保在与包相同的目录中执行命令。现在MySQL找不到必要的文件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6216009

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档