How Can I Install Python 3.7 on Apple Silicon (OSX-ARM64)?

Mary-Kate Olsen
Release: 2024-11-09 06:10:02
Original
756 people have browsed it

How Can I Install Python 3.7 on Apple Silicon (OSX-ARM64)?

Cannot Install Python 3.7 on osx-arm64

Problem:

When attempting to create a new environment with Python 3.7 using Conda, an error arises, indicating that Python 3.7 is unavailable for osx-arm64 (Apple Silicon).

Answer:

No Native Builds Available

Python 3.7 was never officially built for osx-arm64, as Apple Silicon was released after Python 3.8 had been available for a year.

Workaround: Emulation

Immediate alternatives for using Python 3.7 on Apple Silicon systems include using emulation through Rosetta or employing container systems like Docker.

Creating osx-64 Environments

To emulate x86_64 with Rosetta, create osx-64 environments in the following manner:

  • Create an empty environment: conda create -n py37
  • Activate the environment: conda activate py37
  • Set the x86_64 architecture channel(s): conda config --env --set subdir osx-64
  • Install Python and other packages: conda install python=3.7 numpy

YAML

An alternative is to use a YAML environment definition:

  • Create an environment from YAML: CONDA_SUBDIR=osx-64 conda env create -n py37 -f py37.yaml
  • Activate the environment: conda activate py37
  • Set the x86_64 architecture channel(s): conda config --env --set subdir osx-64

Virtualization and Parallels

Instead of emulation, virtualization solutions like Parallels can also be utilized to run x86_64 programs in a virtualized environment on Apple Silicon hardware.

Long-Term Solution

Requesting a native build for python-feedstock to include Python 3.7 for osx-arm64 is a possibility, but it's unlikely to be taken up due to Python 3.7 being in its maintenance phase and dependencies not being available.

The above is the detailed content of How Can I Install Python 3.7 on Apple Silicon (OSX-ARM64)?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template