43秒解锁星露谷物语资源:StardewXnbHack让MOD制作变得如此简单
2026/5/10 18:22:41
本文只采用一种最简单、成功率最高的方案:
切换到阿里云 CentOS 7 SCL Vault 源,安装 devtoolset-10 升级 gcc。
适合人群:
- CentOS 7(7.6 / 7.9 / 云厂商定制版)
- Python 3.11
- pip 安装 SQLAlchemy / greenlet 失败
关键词:
Failed building wheel for greenlet、command '/usr/bin/g++' failed、CentOS 7 EOL
在 CentOS 7 上使用 Python 3.11 执行:
pipinstallSQLAlchemy常见报错如下:
error: command '/usr/bin/g++' failed with exit code 1 ERROR: Failed building wheel for greenlet或者:
× Failed to build installable wheels for some pyproject.toml based projects ╰─> greenletgreenletgreenlet是C++ 扩展模块,需要本地编译CentOS 7 自带:
gcc 4.8.5👉无法编译 greenlet(这是必然结果)
原因只有一个:
CentOS 7 已 EOL,官方 mirrorlist 仓库已下线
典型报错:
Could not retrieve mirrorlist http://mirrorlist.centos.org Cannot find a valid baseurl for repo: centos-sclo-rh因此,继续使用官方源一定失败。
✔ 不改系统 gcc
✔ 成功率高
✔ 生产环境可用
下面是完整可执行步骤。
sudomkdir-p /etc/yum.repos.d/backupsudomv/etc/yum.repos.d/CentOS-SCLo-*.repo* /etc/yum.repos.d/backup/新建 repo 文件:
sudotee/etc/yum.repos.d/CentOS-SCLo.repo<<'EOF' [centos-sclo-rh] name=CentOS-7 - SCLo rh baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/ enabled=1 gpgcheck=0 [centos-sclo-sclo] name=CentOS-7 - SCLo sclo baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/ enabled=1 gpgcheck=0 EOFsudoyum clean allsudoyum makecachesudoyuminstall-y devtoolset-10sclenabledevtoolset-10bash验证:
gcc --version g++ --version# gcc 10.xpipinstall-U pip setuptools wheel pipinstall--no-cache-dir greenlet pipinstall--no-cache-dir SQLAlchemy验证:
python -<<'EOF' import greenlet import sqlalchemy print('OK') EOF只要gcc ≥ 9,greenlet 一定能编译通过。
当你在 CentOS 7 + Python 3.11 环境中遇到:
Failed building wheel for greenlet请直接记住这一条结论:
换阿里云 SCL Vault 源,安装 devtoolset-10,就够了。
如果本文帮你节省了时间,欢迎点赞 / 收藏 / 转发。