M1 Mac / Legacy Python 2.7 Project Setup

I ran into a bunch of roadblocks on this one around virtual environments.

  • Create Rosetta terminal
  • Install homebrew
  • brew install pyenv
  • pyenv install –patch 2.7.16 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch)
  • the above patch was critical to prevent a zlib issue
  • next, the virtual env was non straight forward to get working
  • pyenv local 2.7.16
  • brew install pyenv-virtualenvwrapper
  • export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV=”true”
  • pyenv virtualenvwrapper
  • mkvirtualenv/workon <venv>

Leave a Comment