Yes, this sucks, but look, there are still python2.7 projects out there. Homebrew did the wrong thing by removing their 2.7 forumla.
The system python2.7 doesn't have ability to install virtualenv or even pip.
That said, use homebrew to install zlib and bzip2 and maybe openssl as deps.
brew install openssl zlib bzip2
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/bzip2/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/zlib/include"
I like to add those last 2 lines to my ~/.bashrc
.
Download the Python 2.7 source tarball from python.org, extract it, and install.
curl -LO https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
pushd Python-2.7.18
./configure --prefix=$HOME/python2.7 && make install
Add the python path to your path, maybe add this to your .bashrc. Install pip. install virtual env.
export PATH=$HOME/python2.7/bin:$PATH
python -m ensurepip --upgrade
pip install virtualenv
That is enough to get my project going. GL HF