0

I have been using Plone 4.2 without problems but want to test my site with the upcoming Plone 4.3. I edited my buildout to use Plone 4.3a2 and reran buildout.

Now I get ImportError: cannot import name Schema.

This is what my extends section now looks like (I've included the commented out old reference to Plone 4.2 which has been replaced with the new Plone 4.3a2 url).

extends =
    deco.cfg
    toolbar.cfg
    users-ports.cfg
    base.cfg
    supervisor-cache-balancer.cfg
    products.cfg
#    versions.cfg
#    http://dist.plone.org/release/4.2-latest/versions.cfg
   http://dist.plone.org/release/4.3a2/versions.cfg
   pinnedversions.cfg

After rerunning buildout and launching my instance using bin/client1 fg

I get the following traceback:

from Products.ATContentTypes.criteria import _criterionRegistry
  File "/home/plone/buildout-cache/eggs/Products.ATContentTypes-2.1.7-py2.7.egg/Products/ATContentTypes/criteria/__init__.py", line 123, in <module>
    from Products.ATContentTypes.criteria.relativepath import ATRelativePathCriterion
  File "/home/plone/buildout-cache/eggs/Products.ATContentTypes-2.1.7-py2.7.egg/Products/ATContentTypes/criteria/relativepath.py", line 7, in <module>
    from Products.Archetypes.public import Schema, DisplayList
ImportError: cannot import name Schema

I've even tried to pin Archetypes and ATContentypes so that the buildout uses older versions (example those used in Plone 4.2) by adding the following to my pinnedversions.cfg file (which gets called after everything else).

[versions]
Products.ATContentTypes = 2.1.7
Products.Archetypes = 1.7.14

Even then there seems to be more to it than that, the ImportError: cannot import name Schema error persists. It does not matter what versions I use in the pinnedversions.cfg file it does not work.

All my investigations suggest that this should "just work". Here's what I've inspected so far:

  1. Using bin/client1 debug for troubleshooting I discovered that from Products.Archetypes import Schema, from Products.Archetypes.Schema import Schema and from Products.Archetypes.atapi import Schema all work.

  2. When I open the Products.Archetypes public.py file it includes the following line:

     from Products.Archetypes.atapi import *
    

    My understanding is that such a line would make it possible to import Schema from public.py

David Bain
  • 2,119
  • 1
  • 14
  • 18
  • Have you run a diff on your `pinnedversions.cfg` against the 4.3a2 versions file? It could be that a pin there could have disrupted something Archetypes needs for it's Schema package to work. – Martijn Pieters Oct 21 '12 at 20:24
  • Since pinnedversions.cfg comes last wouldn't those packages get priority, plus I did some grepping in my buildout and those packages are definitely the ones being selected, but not matter what versions I pin in my file it isn't importing Schema from public. – David Bain Oct 21 '12 at 22:56
  • I meant *other* packages conflicting. Perhaps you pinned something that should not be held back. Try a fresh, clean install first and introduce your packages into that. It's something local to your buildout, because noone else has reported this problem yet. – Martijn Pieters Oct 22 '12 at 04:55
  • I agree, it seems local to this buildout. I started fresh with a brand new buildout and so far have had no issues. – David Bain Oct 22 '12 at 11:40
  • 2
    It seems to me that StackOverflow is the wrong place to ask a question about migrating to an alpha-test version. Both question and answer will have no historical value. This belongs on the developers list. – SteveM Oct 22 '12 at 14:52

2 Answers2

1

Just to confirm that enabling products.kupu causes problems for me too.

The problem is fixed on latest plone.app.upgrade, see https://github.com/plone/plone.app.upgrade/commit/676f43c9c9c56eb686e20a5d0c7319540e7bab3f

kiorky
  • 299
  • 1
  • 8
0

After further investigation between a clean 4.3a2 buildout and my buildout, the difference was Products.kupu, commenting out Product.kupu from my eggs section and rerunning buildout solved the problem.

I have not investigated the reason this solves the problem, but it does.

David Bain
  • 2,119
  • 1
  • 14
  • 18
  • As noted by SteveM, this should really show up on the developers, will remember proper protocol for alpha products in the future. – David Bain Apr 10 '13 at 11:43