Combining conda and virtualenv for a viable Python 2.7 buildout environment on Mac

On a Mac I've found the following strategy helpful:

Use conda to create a python2 environment. Then install and use virtualenv in that environment:

conda create --name plonepy2 python=2.7

Do the rest of the commands in the root of your buildout

conda activate plonepy2
conda install virtualenv
virtualenv venv
source venv/bin/activate

I've only tested this on Catalina, not on Big Sur and NOT on an M1 Mac.

I found that a conda environment alone was not enough as I kept getting a couldn't find index page for 'zc.buildout' error
when running python bootstrap-buildout.py

Something like this:

/var/folders/dd/rxwr7nfj6dl_kb09w6kvmz380000gn/T/bootstrap-Q5iDvO/setuptools-33.1.1-py2.7.egg
Couldn't find index page for 'zc.buildout' (maybe misspelled?)
Traceback (most recent call last):
  File "bootstrap-buildout.py", line 199, in <module>
    ws.require(requirement)
  File "build/bdist.macosx-10.7-x86_64/egg/pkg_resources/__init__.py", line 963, in require
  File "build/bdist.macosx-10.7-x86_64/egg/pkg_resources/__init__.py", line 849, in resolve

Once I introduced virtualenv.... problem solved.... python bootstrap-buildout.py

And yes.... you're welcome future self :slight_smile:

1 Like

One thing I like about @pigeonflight is that he addresses issues that I have but haven't asked about yet. Awesome. :grinning:

1 Like