Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon)

We Are Going To Discuss About Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon). So lets Start this Python Article.

Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon)

  1. How to solve Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon)

    Python 3.6 is not support on M1 might due to the fact that 3.6 will reach End Of Line (EOL) at the end of this year (2021).
    I would suggest you to try at least Python 3.7 or higher on M1. Using pyenv, I've succeed install Python 3.7.10, 3.8.6 and 3.9.4 natively on macOS 11 (Apple Silicon). This article would help you though the process, if you're still looking for answer: https://squademy.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9

  2. Installation of earlier versions of Python (prior to 3.8) fails on Mac with M1 Chip (ARM based Apple Silicon)

    Python 3.6 is not support on M1 might due to the fact that 3.6 will reach End Of Line (EOL) at the end of this year (2021).
    I would suggest you to try at least Python 3.7 or higher on M1. Using pyenv, I've succeed install Python 3.7.10, 3.8.6 and 3.9.4 natively on macOS 11 (Apple Silicon). This article would help you though the process, if you're still looking for answer: https://squademy.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9

Solution 1

Python 3.6 is not support on M1 might due to the fact that 3.6 will reach End Of Line (EOL) at the end of this year (2021).

I would suggest you to try at least Python 3.7 or higher on M1. Using pyenv, I’ve succeed install Python 3.7.10, 3.8.6 and 3.9.4 natively on macOS 11 (Apple Silicon). This article would help you though the process, if you’re still looking for answer: https://squademy.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9

Original Author Eugene Of This Content

Solution 2

Nix installed under Rosetta 2 will do the trick. I didn’t even have it installed before running the below — note the message showing Nix downloading Python 3.6 when I requested it.

# yes, this really is a M1 Mac
[email protected] ~ % uname -a
Darwin macbook-pro.lan 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 x86_64 i386 MacBookPro17,1 Darwin
[email protected] ~ % arch
arm64

# ...however, Rosetta was used to install an x86_64 Nix build
[email protected] ~ % file "$(realpath "$(command -v nix)")"
/nix/store/104sp9zrhmh3jycj32jcyl3f13mysdki-nix-2.3.9/bin/nix: Mach-O 64-bit executable x86_64

# ...and that x86_64 Nix build can install and run an x86_64 Python 3.6
[email protected] ~ % nix run nixpkgs.python36 -c python
[1 copied (53.7 MiB), 9.3 MiB DL]
Python 3.6.12 (default, Dec 18 2020, 15:32:50) 
[GCC 4.2.1 Compatible Clang 7.1.0 (tags/RELEASE_710/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

The above (for reproducibility purposes) was collected with nixpkgs referring to the channel https://nixos.org/channels/nixpkgs-20.09-darwin, and specifically to the instance sn5ycj9wkbdmyinvqyg9rn42sw71wqad-nixpkgs-20.09pre245572.f18fbc33930.

Original Author Charles Duffy Of This Content

Solution 3

Using answer of @Charles Duffy you can make older versions run on M1s.
However Python versions before 3.8 will NOT be officially supported on M1 because they were not in bug-fix phase when M1 chips were released. It is stated clearly here as:

“>Are there plans to backport PR 22855 to any branches older than 3.9?

The plan is to also support 3.8 on Big Sur and Apple Silicon as 3.8 is still in bugfix mode. There are no plans to backport support to 3.7 and 3.6 which are in the security-fix-only phase of their release cycles.”

in this python bug tracker.

So I don’t think there is any way to get them working on M1 unless someone tweaks python on their own.

Original Author edited Apr 16, 2021 at 5:02 Of This Content

Solution 4

I was able to install 3.8 from source:

./configure --enable-framework=/Users/MyUName/lib/Frameworks
make && make install

I tried 3.7 and it died during make:

cd Mac && /Applications/Xcode.app/Contents/Developer/usr/bin/make pythonw
gcc  -DPYTHONFRAMEWORK='"Python"' -o pythonw \
        ./Tools/pythonw.c -I.. -I./../Include \
        ../Python.framework/Versions/3.7/Python
./Tools/pythonw.c:125:9: error: "Unknown CPU"
#       error "Unknown CPU"
        ^

I tried 3.6 and it died during config:

checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.

so I tried adding CXX=$(xcode-select -p)/usr/bin/g+ and it didn’t get much further:

checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report

Conda doesn’t even support 3.6 and 3.7 for M1.

Original Author Zach Young Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment