无法在带有 arm M1 的 Macbook 上安装 spaCy

Unable to install spaCy on Macbook with arm M1

正在尝试使用 pip 在 M1 Mac 上安装 spaCy:

pip install 'spacy[apple]'

获取错误:

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

你必须在安装 spacy[apple] 之前安装所有依赖项

安装 preshed
pip install cython 
pip install cymem
pip install murmurhash
pip install preshed
安装幸福
pip install numpy
pip install blis
安装 thinc
pip install thinc

然后最后安装spaCy:

pip install 'spacy[apple]'