Entering edit mode
5 months ago
xiaoleiusc
▴
140
Hi, All,
Is there a way to install Python version 2 on Mac with M3 chips?
Thanks,
Xiao
Hi, All,
Is there a way to install Python version 2 on Mac with M3 chips?
Thanks,
Xiao
This is how I installed python2 on my MacOS Sonoma (14.5) with M3 chips.
brew install pyenv
pyenv install 2.7.18
pyenv init
, and follow instructions to append the following to ~/.zprofile and ~/.zshrcsudo nano ~/.zshrc
, append the following: export PYENV_ROOT="$HOME/.pyenv" [[ -d $PYENV_ROOT/bin ]] && export
PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)"
exec "$SHELL"
pyenv versions
pyenv local 2.7.18
, pyenv global 3.12.4
, or use system version with pyenv global system
. Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Did you try installing it through Conda?
Regards,
Nitin N.
Tried
conda create --name env_py2 python=2.7.18
but failed with error below:Collecting package metadata (current_repodata.json): done Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
Current channels:
To search for alternate channels that may provide the conda package you're looking for, navigate to
and use the search bar at the top of the page.
A quick Google search gave me this solution, which might help.
I think you need to enable the
x86_64
packages and run them usingRosetta2
. There are multiple options to to this. I have two different conda installations on myM1pro
(one usingarm64
one usingx86_64
) and I activate them separately to keep the package architectures separate. However, you can also allowx86_64
packages inarm64
environments: https://stackoverflow.com/questions/70205633/cannot-install-python-3-7-on-osx-arm64