Tip for macOS pyenv+buildout users

A tip for those using a Plone installed via buildout on macOS, when using a pyenv-installed Python:

  • Remember when you upgrade your macOS, you will need to rebuild your pyenv python via pyenv install $VERSION_GOES_HERE β€” or you will make pkg_resources and by proxy zc.buildout.easy_install unhappy with you.

If you do not do this, you may get distribution installation errors related to copying your wheels to the eggs/ directory, because buildout relies on pkg_resources.compatible_platforms() result, which will very much not be the same for your Python built on previous macOS version.

Errors in this case will look like, when running buildout:

The first time you run buildout after your macOS upgrade:

OSError: [Errno 66] Directory not empty: ...

If you try again, you get a slightly different error:

    assert newdist is not None  # newloc above is missing our dist?!
AssertionError

What is seen in pdb for this case β€” say you built Python on Ventura, and upgraded to Sonoma β€” is that what is compared in pkg_resources.compatible_platforms() is not equal:

{'provided': 'macosx-13.6-arm64', 'required': 'macosx-14.3-arm64'}
9 Likes

live saver :heart_eyes:

4 Likes

Just got bitten by this, thank you @seanupton for the tip

2 Likes

just spend hours on debugging until @ericof pointed me to this. thanks for the tip @seanupton

3 Likes

Very helpful.

My workflow fixing a Python 3.13 installed using homebrew:

brew reinstall python@3.13

following Install Plone with Buildout β€” Plone Documentation v6

Then rebuild the venv
python3.13 -m venv venv

rerun install of requirements. (not 100% sure if necessary)
venv/bin/pip install -r https://dist.plone.org/release/6-latest/requirements.txt

rerun bootrap of buildout:
venv/bin/buildout bootstrap

rerun
bin/buildout

done!

1 Like

thx for this hint, but what if it does not help?
I have installed different 3.8.x versions and removed buildout cache, but ending up always with the same error while installing plone.restapi==7.9.0.
Any ideas?

it's happening here:

-> if dist_infos == [(dist.project_name.lower(), dist.parsed_version)]:
(Pdb) dist_infos                                                                                                               
[('plone-restapi', <Version('7.9.0')>)]
(Pdb) [(dist.project_name.lower(), dist.parsed_version)]                                                                       
[('plone.restapi', <Version('7.9.0')>)]   

again plone.restapi vs plone-restapi :slight_smile:

I am unsure if there is any Python 3.8 / Plone 5.2 parallel to what is described for latest setuptools in Plone 6.1.x here.

What I notice on PyPI is that plone.restapi == 7.9.0 is only available as a source distribution β€” I do not know if that helps narrow down what might be happening here.

I can say that I have been able to run plone.restapi = 8.37.0 in a Plone 5.2 on Python 3.8 without issue; this version has a built platform-agnostic wheel distribution on PyPI.

1 Like

@mauritsvanrees released a wheel of plone.restapi 7.9.0 today, which can help. It might also help to update to zc.buildout 3.3. And, like Sean said, there are newer releases of plone.restapi which are still compatible with Plone 5.2.