Is there a way to install Python version 2 on Mac with M3 chips?
Hi, All,
Is there a way to install Python version 2 on Mac with M3 chips?
Thanks,
Xiao
• 3,942 views
•
link
1 answer
This is how I installed python2 on my MacOS Sonoma (14.5) with M3 chips.
brew install pyenvpyenv install 2.7.18pyenv 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 -)"
- To exit nano, press “control + x”, the press “y”.
- Refresh shell with
exec "$SHELL" - Check installed python versions with
pyenv versions - Choose a version to run locally or globally, for example,
pyenv local 2.7.18,pyenv global 3.12.4, or use system version withpyenv global system.
• 0 views
•
link
Log in to answer this question.
Did you try installing it through Conda?
Regards,
Nitin N.
Tried
conda create --name env_py2 python=2.7.18but 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_64packages and run them usingRosetta2. There are multiple options to to this. I have two different conda installations on myM1pro(one usingarm64one usingx86_64) and I activate them separately to keep the package architectures separate. However, you can also allowx86_64packages inarm64environments: https://stackoverflow.com/questions/70205633/cannot-install-python-3-7-on-osx-arm64