Mac M1使用conda创建tf2环境报错:找不到python==3.9包
问题原因及解决办法
错误原因
Mac M1采用osx-arm64架构,你当前使用的conda默认defaults频道未提供适配该架构的Python 3.9安装包,因此环境创建时无法找到对应资源,导致失败。
解决办法
添加conda-forge频道并创建环境
conda-forge社区维护的频道提供了更完整的arm架构适配包,先配置频道再创建环境:conda config --add channels conda-forge conda config --set channel_priority strict conda create --name tf2 python=3.9注意:版本指定需用单等号
python=3.9,双等号python==3.9并非conda的标准版本指定语法。创建环境时临时指定频道
若不想全局修改频道配置,可在创建命令中直接指定conda-forge频道:conda create --name tf2 python=3.9 -c conda-forge更新conda至最新版本
旧版conda对arm64架构的支持存在局限,先更新conda再尝试创建:conda update -n base -c conda-forge conda conda create --name tf2 python=3.9
内容的提问来源于stack exchange,提问作者Jacques
相关产品推荐
相关产品推荐

