在Centos 6.4上安装mysql-python

时间:2014-10-09 07:30:44

标签: python mysql django centos

  

(env)[root @ RISERVER Audiotube] #pip install mysql-python

从上面的命令我得到以下错误...

_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)

注意: centos,virtualenv

1 个答案:

答案 0 :(得分:0)

我的猜测是你必须安装软件包&#34; python-devel&#34;。