记录一下遇到的坑:
- 千万不要把x86的全部数据直接迁移到M1。不然miniconda都装不上。
- 重装系统得到一个干净的环境,就可以简单的安装上miniconda了。
- create一个虚拟环境,去装包
conda create -n your_env_name python=3.8.8(其他的也行)
source activate your_env_name
- M1系统安装scripy有问题:
brew install openblas
export LDFLAGS="-L/opt/homebrew/opt/openblas/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openblas/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openblas/lib/pkgconfig"
pip install cython pybind11 pythran numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
OPENBLAS=$(brew --prefix openblas) CFLAGS="-falign-functions=8 ${CFLAGS}" pip install --no-use-pep517 scipy==1.7.0
然后就安装成功了。
- 安装sklearn:
OPENBLAS=$(brew --prefix openblas) CFLAGS="-falign-functions=8 ${CFLAGS}" pip install sklearn -i htt