Unable to install python2.7 in a new env

Hi!
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
https://docs.anaconda.com/free/anaconda/configurations/switch-environment.html
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.

1 Like

Hi!
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!
Cheers
Amalia