TypeError: Error when calling the metaclass bases

198 views
Skip to first unread message

Reguillo

unread,
Aug 27, 2010, 6:08:24 AM8/27/10
to Better Python
This occurs when trying to run "python ./wx_demo.py" from the command
line.
I find it strange that the traceback includes the original
installation files.


Traceback (most recent call last):
File "./wx_demo.py", line 2, in <module>
from mext.reaction.wx_utils import *
File "/home/reg/software/reaction_508/reaction/mext/reaction/
wx_utils.py", line 4, in <module>
from mext.reaction.eventloop import *
File "/home/reg/software/reaction_508/reaction/mext/reaction/
eventloop.py", line 9, in <module>
class EventLoop(Component, ServiceStub):
File "/usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-
py2.6.egg/mext/classhacks.py", line 61, in __new__
cls = super(classy_class, meta).__new__(meta, name, bases, cdict)
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases

Sergey Schetinin

unread,
Aug 27, 2010, 6:13:39 AM8/27/10
to better...@googlegroups.com
It seems like your mext.context is out of date, but setup.py seems to
depend on the correct version. Does the problem persist after running
"setup.py develop" ?

> --
> Mailing list: http://groups.google.com/group/better-python
> Unsubscribe: better-pytho...@googlegroups.com

--
Best Regards,
Sergey Schetinin

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reguillo

unread,
Aug 27, 2010, 6:20:46 AM8/27/10
to Better Python
$ python setup.py develop

running develop
running egg_info
writing requirements to Reaction.egg-info/requires.txt
writing Reaction.egg-info/PKG-INFO
writing namespace_packages to Reaction.egg-info/namespace_packages.txt
writing top-level names to Reaction.egg-info/top_level.txt
writing dependency_links to Reaction.egg-info/dependency_links.txt
reading manifest file 'Reaction.egg-info/SOURCES.txt'
writing manifest file 'Reaction.egg-info/SOURCES.txt'
running build_ext
Creating /usr/lib/python2.6/site-packages/Reaction.egg-link (link
to .)
Reaction 0.2.2 is already the active version in easy-install.pth

Installed /home/reg/software/reaction_508/reaction
Processing dependencies for Reaction==0.2.2
Searching for mext.context==0.6.1.r2233
Best match: mext.context 0.6.1.r2233
Processing mext.context-0.6.1.r2233-py2.6.egg
mext.context 0.6.1.r2233 is already the active version in easy-
install.pth

Using /usr/lib/python2.6/site-packages/mext.context-0.6.1.r2233-
py2.6.egg
Searching for mext.hacks==0.10.r2224
Best match: mext.hacks 0.10.r2224
Processing mext.hacks-0.10.r2224-py2.6.egg
mext.hacks 0.10.r2224 is already the active version in easy-
install.pth

Using /usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-py2.6.egg
Finished processing dependencies for Reaction==0.2.2



Still the same error after doing "setup.py develop"

On Aug 27, 12:13 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> It seems like your mext.context is out of date, but setup.py seems to
> depend on the correct version. Does the problem persist after running
> "setup.py develop" ?
>
> http://self.maluke.com/-- My articles and open-source stuffhttp://www.maluke.com/-- My commercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 6:25:04 AM8/27/10
to better...@googlegroups.com
Do the automated tests pass?
What happens if you try to this in python console?:

>>> import mext.reaction.eventloop

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reguillo

unread,
Aug 27, 2010, 6:39:40 AM8/27/10
to Better Python
If by automated tests you mean: python setup.py test, I can't run
those yet, the error msg is in the other thread.


On the python console:

$ python
Python 2.6.4 (r264:75706, Dec 22 2009, 17:55:44)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mext.reaction.eventloop
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/Reaction-0.2.2-py2.6.egg/mext/
reaction/eventloop.py", line 9, in <module>
class EventLoop(Component, ServiceStub):
File "/usr/lib/python2.6/site-packages/mext.hacks-0.10.r2224-
py2.6.egg/mext/classhacks.py", line 61, in __new__
cls = super(classy_class, meta).__new__(meta, name, bases, cdict)
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases
>>>

Seems like the same error.

On Aug 27, 12:25 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> Do the automated tests pass?
> What happens if you try to this in python console?:
>
> >>> import mext.reaction.eventloop
>
> >>http://self.maluke.com/--My articles and open-source stuffhttp://www.maluke.com/--My commercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 6:45:17 AM8/27/10
to better...@googlegroups.com
Try this and copy what output you get:

>>> from mext.context import ServiceStub
>>> ServiceStub.__mro__
(<class 'mext.context.ServiceStub'>, <class 'mext.context.Service'>,
<class 'mext.context._ClassDelegate'>, <class
'mext.classhacks.classy'>, <type 'object'>)

>>> from mext.reaction import Component
>>> Component.__mro__
(<class 'mext.reaction.component.Component'>, <class
'mext.classhacks.classy'>, <type 'object'>)

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reguillo

unread,
Aug 27, 2010, 6:55:58 AM8/27/10
to Better Python

My output:
>>> from mext.context import ServiceStub
>>> ServiceStub.__mro__
(<class 'mext.context.ServiceStub'>, <class 'mext.context.Service'>,
<class 'mext.context._ClassDelegate'>, <class
'peak.util.decorators.classy'>, <type 'object'>)
>>> from mext.reaction import Component
>>> Component.__mro__
(<class 'mext.reaction.component.Component'>, <class
'mext.classhacks.classy'>, <type 'object'>)
>>>


On Aug 27, 12:45 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> Try this and copy what output you get:
>
> >>> from mext.context import ServiceStub
> >>> ServiceStub.__mro__
>
> (<class 'mext.context.ServiceStub'>, <class 'mext.context.Service'>,
> <class 'mext.context._ClassDelegate'>, <class
> 'mext.classhacks.classy'>, <type 'object'>)
>
> >>> from mext.reaction import Component
> >>> Component.__mro__
>
> (<class 'mext.reaction.component.Component'>, <class
> 'mext.classhacks.classy'>, <type 'object'>)
>
> >> >>http://self.maluke.com/--Myarticles and open-source stuffhttp://www.maluke.com/--Mycommercial software and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 7:01:46 AM8/27/10
to better...@googlegroups.com
Well, basically, for some reason the mext.context that gets imported
is not the 0.6+ version it should be.
To confirm try this:

>>> import mext.context
>>> mext.context.__file__

The setup.py develop output says that the correct version is
installed, but the console output from your last email tells me it
does not get imported. One way to fix that is to go to your
site-packages directory and delete all mext.context dirs and zipfiles
and install it again.

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reguillo

unread,
Aug 27, 2010, 7:25:13 AM8/27/10
to Better Python
Ok it worked.

What I did was:
rm -rf ./Contextual_fork-0.3.r1315-py2.6.egg
rm -rf ./Contextual-0.7a1.dev_r2570-py2.6.egg

and easy_install mext.context

Installed /usr/lib/python2.6/site-packages/mext.context-0.6.1.r2233-
py2.6.egg

>>> import mext.context
>>> mext.context.__file__
'/usr/lib/python2.6/site-packages/mext.context-0.6.1.r2233-py2.6.egg/
mext/context.pyc'
>>> import mext.reaction.eventloop
>>>

The demos run too.

Thanks for the fast help and responses.


On Aug 27, 1:01 pm, Sergey Schetinin <mal...@gmail.com> wrote:
> Well, basically, for some reason the mext.context that gets imported
> is not the 0.6+ version it should be.
> To confirm try this:
>
> >>> import mext.context
> >>> mext.context.__file__
>
> The setup.py develop output says that the correct version is
> installed, but the console output from your last email tells me it
> does not get imported. One way to fix that is to go to your
> site-packages directory and delete all mext.context dirs and zipfiles
> and install it again.
>
> >> >> >>http://self.maluke.com/--Myarticlesand open-source stuffhttp://www.maluke.com/--Mycommercialsoftware and custom development services

Sergey Schetinin

unread,
Aug 27, 2010, 7:28:46 AM8/27/10
to better...@googlegroups.com
OK, great.

http://self.maluke.com/ -- My articles and open-source stuff
http://www.maluke.com/ -- My commercial software and custom development services

Reply all
Reply to author
Forward
0 new messages