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

本文详细解析了在尝试安装mysql-python模块时遇到的错误:无法执行gcc,导致命令失败。指出错误原因是系统中缺失gcc编译器,并提供了解决方案:通过使用yum命令安装gcc编译器,再重新安装mysql-python。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错内容

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值