1. 背景
用 macos m1 安装 Manim Community v0.13.1,
按照教程 :MacOS - Manim Community v0.13.1https://docs.manim.community/en/stable/installation/macos.html
在执行最后一步:
> pip3 install manim
时报错:
> ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/k4/p9g4ps21591dxw6xjnzdtszr0000gn/T/tmp73i41hzn Check the logs for full command output.
2. 解决
主要是由于 python3 默认的路径跟指定的路径不一样,需要配置环境变量,在 ~/.zprofile 中梗概 python3 的路径,在环境变量中可以看到其指定的路径是 pip3 -V 下给出的路径,而不是要求的 opt/homebrew 的路径。
在 zprofile 中有一个特点,就是后来者居上,即后面的指定比前面的具有优先级,因此,需要在 zprofile 指定python3的最后面重新指定python3的路径,即:
>
PATH="/opt/homebrew/bin:${PATH}"
export PATH
3. 问题解决
反省:安装遇见问题后,经验之谈,百分之八十以上都是环境配置的问题!