gpt4 book ai didi

python - 无法安装 MySQL-Python

转载 作者:行者123 更新时间:2023-11-29 02:05:49 25 4
gpt4 key购买 nike

出于某种原因,我无法在我的 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 5.5.10 和 Python 2.6。从 MySQL-3.23 到 5.0 支持当前版本的 MySQL-python(版本 1.2.3)。但是您可以尝试通过 ActivePython 安装它.

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

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

我在 Fedora 15 平台上使用 MySQL 5.5 和 Python 2.7 时遇到了类似的情况,它对我来说效果很好。

关于python - 无法安装 MySQL-Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6216009/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com