You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级macOS Catalina后Jupyter中pip安装python-binance失败求助

Fixing pip install python-binance Error on macOS Catalina 10.15.5

Hey there, I’ve run into this exact headache after updating macOS before—let’s get this sorted out for you! The core issue jumps right out of your error logs: your Xcode Command Line Tools are either missing or have an invalid path, which breaks the compilation of the regex dependency required by python-binance.

Step 1: Repair Xcode Command Line Tools

First, let’s fix the root cause:

  • Open your terminal (or a new terminal tab in Jupyter Notebook) and run this command:

    xcode-select --install
    

    A system dialog will pop up asking you to install the Command Line Tools. Follow the prompts to finish the installation—it might take a few minutes to download and set up.

  • If you get an error saying the tools are already installed but the path is still messed up, reset the path with:

    sudo xcode-select --reset
    

    Double-check the path is correct afterward by running:

    xcode-select -p
    

    It should return /Library/Developer/CommandLineTools.

Step 2: Retry the Installation

Once the Command Line Tools are fixed, try installing python-binance again. Since you’re using Anaconda, you have two solid options:

  1. Use pip (now that the compilation block is removed):
    pip install python-binance
    
  2. Or use conda (which often skips compilation headaches by using pre-built packages):
    conda install -c conda-forge python-binance
    

Step 3: Bonus: Upgrade Pip (If Needed)

If you still hit snags, make sure your pip is up to date—older versions can cause random compatibility issues:

pip install --upgrade pip

Why This Happens

macOS updates (like your Catalina 10.15.5 upgrade) sometimes reset or corrupt the Xcode Command Line Tools path. The regex package needs to compile a C extension, which relies on gcc and other tools from the Command Line Tools—without them, the installation can’t proceed.

内容的提问来源于stack exchange,提问作者0xyan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 13:22:50