其它 · 11/19/2020 0

Big Sur pip安装报错

新升级使用pip安装报错:

c/_cffi_backend.c:5854:2: error: Apple Arm64 ABI requires ffi_prep_cif_var
#error Apple Arm64 ABI requires ffi_prep_cif_var

暂时解决访问:brew 安装新的python,不使用系统自带。

brew install python3
brew link python3
#如果提示brew Error: Permission denied @ dir_s_mkdir – /usr/local/Frameworks,执行:
sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks

#安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
sudo python3 get-pip.py    # 运行安装脚本

pip安装碰到错误解决:'openssl/opensslv.h' file not found,解决

brew install openssl
#安装后制定环境变量安装
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" python3 pip install xxx