安装glove_python时gcc命令执行失败(退出状态1)求助
glove-python Installation Failure (gcc Error) I’ve run into this exact issue on macOS before—here are the most reliable fixes to get glove-python installed successfully:
1. Install Xcode Command Line Tools (First Step!)
The gcc error usually means your system is missing the necessary C compiler tools. On macOS, these are included in Xcode Command Line Tools. Run this in your terminal:
xcode-select --install
Follow the on-screen prompts to complete the installation, then try running pip install glove_python again.
2. Use Precompiled Binary Package (Skip Compilation)
If compiling from source keeps failing, use the prebuilt glove-python-binary package instead. It avoids the gcc compilation step entirely:
pip install glove-python-binary
This package works exactly like the original glove-python but doesn’t require you to set up a compiler.
3. Update Dependencies First
Outdated or missing dependencies often cause compilation issues. Make sure numpy and scipy (which glove-python relies on) are up-to-date:
pip install --upgrade numpy scipy
Then attempt the original install again:
pip install glove_python
4. Use a Fresh Conda Environment
If you’re using Anaconda, conflicts in your main environment might be causing the error. Create a clean environment and try installing there:
conda create -n glove_env python=3.8 conda activate glove_env pip install glove_python
Conda often handles system dependencies better for compiled packages.
内容的提问来源于stack exchange,提问作者Shagun Pruthi

