首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用musixmatch包装器时出错

使用musixmatch包装器时出错
EN

Stack Overflow用户
提问于 2013-06-20 23:46:46
回答 1查看 281关注 0票数 2

我一直在尝试使用musixmatch python wrapper,但在尝试运行example时出现了一个奇怪的错误。谁能告诉我应该做些什么来修理库?

代码语言:javascript
复制
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import musixmatch.ws
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "musixmatch/ws.py", line 14, in <module>
    import musixmatch.api
  File "musixmatch/api.py", line 167, in <module>
    class XMLResponseMessage(ResponseMessage, etree.ElementTree):
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-24 17:07:25

正如@jdi Python解释的那样,它是一个元类混淆:in this question不知道从哪个类派生XMLResponseMessage。(它不能同时来自两个可能的钻石继承)

有一个活动状态配方可以自动解决这个问题(无冲突模块):http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/。缺点是您必须深入lib代码并对其进行修改以解决冲突。

据我所知,这个库是为开发人员量身定做的,并且只能在他的环境中运行: python 2.7 (metaclass clash)和python 3.3 (无法安装egg模块)都无法安装和测试该模块。我建议您将代码派生出来,并根据您的需要进行调整。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17218116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档