欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

安装mysql-python报错unable to execute gcc: No such file or directory

程序员文章站 2022-07-15 16:44:17
...

报错内容

unable to execute gcc: No such file or directory
error: command ‘gcc’ failed with exit status 1
----------------------------------------
Command “/home/work/dashboard/env/bin/python -u -c “import setuptools,
tokenize;file=’/tmp/pip-install-KO8uV3/mysql-python/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’,
‘\n’);f.close();exec(compile(code, file, ‘exec’))” install
–record /tmp/pip-record-KOLqmG/install-record.txt --single-version-externally-managed --compile --install-headers /home/work/dashboard/env/include/site/python2.7/mysql-python” failed
with error code 1 in /tmp/pip-install-KO8uV3/mysql-python/

报错原因:缺少gcc编译器

解决方法:安装gcc编译器

yum install -y gcc

然后再安装mysql-python

yum install -y mysql-python