Issue
Is it possible to have 2 different versions of python with different architecture on M1 macbook with tools like pyenv
?
For instance, I would like to have 3.9.1
on ARM and 3.8.5
on x86 (via rosetta).
I have pyenv
installed already with a new homebrew 3.0.0
. Having that, I am able to install 3.9.1 for ARM (pyenv install 3.9.1
). Can I now have another version which would be through rosetta?
Solution
Here is a solution that does just that. I hope it's still useful.
Quick summary:
- Make sure Rosetta 2 is installed (it translates software designed for x86 to something ARM can digest)
- Install a x86 and a ARM version of homebrew
- Install a x86 and a ARM version of the packages required by pyenv.
- Install pyenv
- Use aliases to refer to a x86 and an ARM version of pyenv
- Use pyenv-alias to install and refer to x86 and/or ARM python versions.
Answered By - Antropath Answer Checked By - Willingham (WPSolving Volunteer)