pip安装mysql_python报错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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(‘
‘, ‘
‘), __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
以上是关于pip安装mysql_python报错的主要内容,如果未能解决你的问题,请参考以下文章
Python2安装数据库驱动(Mysql_Python)失败问题