Plone 6/Python 3.8/Mac M1

I am trying to create a Plone 6 buildout (created with plonecli) on my Mac with M1 processor, Python 3.8 from Homebrew...but the buildout fails..any idea?

(zopyx.usersascontent) ajung@suxmac ➜  zopyx.usersascontent git:(master) ✗  bin/buildout
Develop: '/Users/ajung/src/zopyx.usersascontent/.'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Uninstalling _mr.developer.
Unused options for buildout: 'download-irectory' 'eggs' 'package-extras' 'plone-user' 'test-eggs'.
Installing _mr.developer.
Generated script '/Users/ajung/src/zopyx.usersascontent/bin/develop'.
Installing instance.
Getting distribution for 'plone.app.referenceablebehavior'.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name '_main' from 'pip.__main__' (/Users/ajung/src/zopyx.usersascontent/lib/python3.8/site-packages/pip/__main__.py)
An error occurred when trying to install /var/folders/_r/z0flwq194cbc12rs83w355k00000gn/T/tmpefnr9v3dget_dist/plone.app.referenceablebehavior-0.7.8.tar.gz. Look above this message for any errors that were output by pip install.

Looks like it tries to use pip as an API, which is discouraged by pip ( m( - but not nothing new).

Do you use Plone 6 alpha2 or coredev?

There seems to be bugs left anyway in bobtemplates.plone, like this typo:

`Unused options for buildout: 'download-irectory'

I can offer you an (experimental/ WIP, but working) alternative with the plone-kickstarter Makefile/mxdev/pip process installed over a plonecli generated addon. That said, I need more feedback here in order to fix things if necessary. So anyway I would appreciate if you may have a critical look at it.

The buildout hangs on plone.app.referenceablebehavior, which shouldn't work/be installed in Python 3, according to the the changelof of the latest released version:

Bug fixes:
Prevent installation on Python 3, as we know Archetypes does not work there. [maurits] (#3330)

1 Like

I have the same error with Python 3.9.9 on an Intel Mac:

Getting distribution for 'ExtensionClass==4.5.0'.
Fetching ExtensionClass 4.5.0 from: https://files.pythonhosted.org/packages/f0/0f/60bd2c1eb2f4c92ce59ff6c0a9977424616ff6c3d393890ee6bdb4ae980f/ExtensionClass-4.5.0.tar.gz#sha256=4b81181889c915b06faac02a5692ab77d9a11a16a0d29d7072b1c8301afd4ebb
Running pip install:
"/Volumes/Work/Customers/it-spirit/Sources/Plone/spirit.plone.addressfield/venv/bin/python3.9" "-c" "import sys; sys.path[0:0] = []; from pip.__main__ import _main; _main()" "install" "--no-deps" "-t" "/Volumes/Work/Configurations/buildout/shared-eggs/tmpz9h8hzkb" "-v" "/Volumes/Work/Configurations/buildout/downloads-cache/dist/ExtensionClass-4.5.0.tar.gz"
path=[]

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name '_main' from 'pip.__main__' (/Volumes/Work/Customers/it-spirit/Sources/Plone/spirit.plone.addressfield/venv/lib/python3.9/site-packages/pip/__main__.py)
An error occurred when trying to install /Volumes/Work/Configurations/buildout/downloads-cache/dist/ExtensionClass-4.5.0.tar.gz. Look above this message for any errors that were output by pip install.
python -V
Python 3.9.9

If in my case ExtensionClass was installed with Python3.7 before, buildout runs fine, but then I get this strange error with Python 3.9:

Traceback (most recent call last):
  File "/Volumes/Work/Customers/it-spirit/Sources/Plone/spirit.plone.addressfield/src/spirit/plone/addressfield/tests/test_setup.py", line 3, in <module>
    from plone import api
  File "/Volumes/Work/Configurations/buildout/shared-eggs/plone.api-2.0.0a2-py3.9.egg/plone/api/__init__.py", line 3, in <module>
    from plone.api import content
  File "/Volumes/Work/Configurations/buildout/shared-eggs/plone.api-2.0.0a2-py3.9.egg/plone/api/content.py", line 7, in <module>
    from plone.api import portal
  File "/Volumes/Work/Configurations/buildout/shared-eggs/plone.api-2.0.0a2-py3.9.egg/plone/api/portal.py", line 3, in <module>
    from Acquisition import aq_inner
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Acquisition-4.7-py3.7.egg/Acquisition/__init__.py", line 13, in <module>
    import ExtensionClass
  File "/Volumes/Work/Configurations/buildout/shared-eggs/ExtensionClass-4.5.0-py3.7.egg/ExtensionClass/__init__.py", line 355, in <module>
    from ._ExtensionClass import *  # NOQA
ModuleNotFoundError: No module named 'ExtensionClass._ExtensionClass'

Notice that ExtensionClass is coming from ExtensionClass-4.5.0-py3.7.egg!

Has anyone seen this before?

I was finally able to solve it for me with those versions pinned:

setuptools==50.3.2
zc.buildout==2.13.3

The problem is the newer zc.buildout (above 3.0.0b1 until the latest rc1) and setuptools newer than 51.x (for Python 3.7 and 3.8).

But this only happens on macos, not during any CI runs.

@zopyx, could you please check your buildout with those specific versions?

yes, this solves my issue too

1 Like