解决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

相关推荐
2501_915918412 小时前
免 Xcode 开发 iOS,工具链替代方案与编译、签名、安装
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
ty_xiumud5 小时前
以太网 MAC 详解:帧格式、位序、FCS 与收发流程
开发语言·macos·php
营养充电站7 小时前
C++23 新特性在 CLion 中的实战体验
macos·docker·jupyter·正则表达式
liliangcsdn8 小时前
如何为m1 mac安装arm版node
macos
2501_916008891 天前
移动安全之 APP 加固,保障移动应用安全的重要手段
安全·macos·ios·小程序·uni-app·iphone·xcode
艾莉丝努力练剑1 天前
Mac 远程桌面体验:6 个工具的 macOS 适配情况整理
linux·运维·服务器·macos·面试
YH55269842 天前
MacBook Air M4 和 M5 怎么选?
macos
MoSTChillax2 天前
数字人竞品分析(中):核心功能、产品使用与技术能力对比
ide·macos·xcode
码农阿豪3 天前
【金仓数据库征文】Mac开发环境|SpringBoot3 + MyBatisPlus对接KES V9 Docker实战全指南
数据库·macos·docker