pip安装mysql_python报错

pip安装mysql_python报错


    _mysql.c:29:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-gmcywp/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-uSDDOK-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-gmcywp/MySQL-python/
You are using pip version 8.1.2, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

这个报错是应为没有安装python-devel造成的。安装一下这个软件即可
Centos:yum -y insatll python-devel

猜你喜欢

转载自blog.51cto.com/13447608/2280883