Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/362.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/8/mysql/69.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_Python_Mysql_Installation - Fatal编程技术网

无法安装MySQL Python

无法安装MySQL Python,python,mysql,installation,Python,Mysql,Installation,由于某些原因,我无法在virtualenv或OS X上的主Python安装中安装MySQL Python包。我得到以下输出: Downloading/unpacking MySQL-Python Running setup.py egg_info for package MySQL-Python warning: no files found matching 'MANIFEST' warning: no files found matching 'ChangeL

由于某些原因,我无法在virtualenv或OS X上的主Python安装中安装MySQL Python包。我得到以下输出:

    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

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

看来您已经安装了MySQL 5.5.10和Python 2.6。 MySQL-3.23到5.0支持当前版本的MySQL python(版本1.2.3)。 但是,您可以尝试通过安装。

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

/opt/ActivePython-2.6/bin/pypm install mysql-python

在我的Fedora 15平台上,MySQL 5.5和Python 2.7也有类似的情况,对我来说效果很好。

属于superuser.com感谢你帮助我格式化输出经过3个小时的挫折,这救了我一天!谢谢@我很高兴听到这个答案有助于解决你的问题。