Unable to install python2.7 in a new env

I have recently installed anaconda on my MacBook Pro (M2) and its version and python’s version are “23.9.0” and “3.11.6” respectively. I need python 2.7 as well. So, according to
I do conda create --name py2 python=2.7 but it does not work and gives me this:

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:

  - python=2.7

I also did conda create --override-channels -c defaults -n py27 python=2.7 according to GitHub community but still it does not work. Could you please help me with this? I appreciate your help in advance. Thanks.


I’m having the same problem.
I tried installing it with brew:
$ brew install python@2.7

but I couldn’t do it either.
Warning: No available formula with the name “python@2.7”. Did you mean python@3.7, python@3.12, python@3.8, python@3.9, python@3.11, python@3.10 or python-yq?

==> Searching for similarly named formulae and casks…

Does anyone know how to install python 2.7 on macOS?

Thank you in advance!

same situation here. Still trying to figure it out.

Your issue is connected to the fact that you are trying to install a version on an M1/M2 Mac - there are no native binaries for this architecture.

Solutions exist but they will be more extensive - see macos - Anaconda channel for installing python 2.7 - Stack Overflow or you may be able to install it via pip