解决Mac M1芯片conda创建python3.7环境报错

今天在macbook 上使用 conda 创建 python3.7 环境时报错

shell 复制代码
conda create --name py37 python=3.7

错误如下:

shell 复制代码
Channels:
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python=3.7*

Current channels:

  - defaults

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

起初我还以为是连接 channel 的问题,换了阿里云等镜像源进行连接,但是仍然没有得到解决。因此,在排除连接 channel 的问题之后,联想到之前 win 下的环境创建没有问题,因此我怀疑与 M1 的 Arm 架构有关,在查找之后找到了模拟x86_64的解决方案。

shell 复制代码
## create empty environment
conda create -n py37

## activate
conda activate py37

## use x86_64 architecture channel(s)
conda config --env --set subdir osx-64

## install python, numpy, etc.
conda install python=3.7

参考:https://stackoverflow.com/questions/70205633/cannot-install-python-3-7-on-osx-arm64

相关推荐
小草cys16 小时前
Mac 在恢复模式下出现 旋转地球图标 但进度非常缓慢
macos
救救孩子把18 小时前
Mac 环境下 JDK 版本切换全指南
java·开发语言·macos
Superstarimage21 小时前
使用conda创建python虚拟环境,并自定义路径
windows·python·conda
humiaor1 天前
Xcode报错:“Set `maskView` to `nil` before adding it as a subview of ZFMaskView
ide·macos·xcode·ios18报错
Decadent丶沉沦1 天前
mac-M系列芯片安装软件报错:***已损坏,无法打开。推出磁盘问题
macos
SoraLuna1 天前
「Mac畅玩AIGC与多模态41」开发篇36 - 用 ArkTS 构建聚合搜索前端页面
前端·macos·aigc
有梦想的攻城狮1 天前
mac本地docker镜像上传指定虚拟机
macos·docker·eureka
深井冰水1 天前
Pycharm的终端执行allure命令出现command not found
macos·pycharm·接口自动化
黄昏贩卖机1 天前
mac latex vscode 配置
ide·vscode·macos
正在走向自律2 天前
Conda 完全指南:从环境管理到工具集成
开发语言·python·conda·numpy·fastapi·pip·开发工具