在CentOS 6.4
问题描述:
(ENV)[根@ RISERVER Audiotube]#PIP从上述命令我得到以下错误安装mysql-蟒在CentOS 6.4
...
_mysql.c:2760: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2848: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2938: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:3010: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:3058: warning: return type defaults to ‘int’
_mysql.c: In function ‘DL_EXPORT’:
_mysql.c:3058: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:3166: error: expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /mnt/external/project/audiotube/project/env/bin/python -c "import setuptools, tokenize;__file__='/mnt/external/project/audiotube/project/env/build/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MO14TZ-record/install-record.txt --single-version-externally-managed --compile --install-headers /mnt/external/project/audiotube/project/env/include/site/python2.6 failed with error code 1 in /mnt/external/project/audiotube/project/env/build/mysql-python
Traceback (most recent call last):
File "/mnt/external/project/audiotube/project/env/bin/pip", line 11, in <module>
sys.exit(main())
File "/mnt/external/project/audiotube/project/env/lib/python2.6/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/mnt/external/project/audiotube/project/env/lib/python2.6/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 33: ordinal not in range(128)
安装MySQL-蟒
注:CentOS的,virtualenv中
答
我的猜测是,你必须安装包 “中的python-devel的”。
你应该粘贴前几个错误消息,我猜你的问题是由于缺少一些'* mysql * .h'文件引起的。 – WKPlus 2014-10-09 09:15:40