Sphinx 1.8 Typeerror元类冲突,Python 2.7 - python

我正在为python 2.7中的项目使用sphinx 1.8文档生成。
我有一个继承三个类的类:

class Meta(type(QtGui.QWidget), type(BaseClass)):
    pass

class UI(QWidget, BaseClass, BaseWidget)
    __metaclass__ = Meta

    def __init__(self):
        QtGui.QWidget.__init__(self)
        BaseClass.__init__(self)
        BaseWidget.__init__(self)

Python应用程序中没有错误。

但是,使用sphinx 1.8时,会产生以下错误:
TypeError:元类冲突:派生类的元类必须是其所有基元元类的(非严格)子类。

有人可以帮忙吗?

python大神给出的解决方案

问题出在Sphinx使用的是Python 3而不是Python 2.7。
我有另一个在Python 3中运行的项目。
为了解决该错误,强制Sphinx使用Python 2.7版本。
在make.bat文件中:
删除if语句,并显式设置SPHINXBUILD路径:

@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

set SPHINXBUILD= "C:\\Python27\\Scripts\\sphinx-build.exe"

set SOURCEDIR=.
set BUILDDIR=_build

它不会再给元类带来错误。

Python sqlite3数据库已锁定 - python

我在Windows上使用Python 3和sqlite3。我正在开发一个使用数据库存储联系人的小型应用程序。我注意到,如果应用程序被强制关闭(通过错误或通过任务管理器结束),则会收到sqlite3错误(sqlite3.OperationalError:数据库已锁定)。我想这是因为在应用程序关闭之前,我没有正确关闭数据库连接。我已经试过了: connectio…

Python pytz时区函数返回的时区为9分钟 - python

由于某些原因,我无法从以下代码中找出原因:>>> from pytz import timezone >>> timezone('America/Chicago') 我得到:<DstTzInfo 'America/Chicago' LMT-1 day, 18:09:00 STD…

用大写字母拆分字符串,但忽略AAA Python Regex - python

我的正则表达式:vendor = "MyNameIsJoe. I'mWorkerInAAAinc." ven = re.split(r'(?<=[a-z])[A-Z]|[A-Z](?=[a-z])', vendor) 以大写字母分割字符串,例如:'我的名字是乔。 I'mWorkerInAAAinc”变成…

如何打印浮点数的全精度[Python] - python

我编写了以下函数,其中传递了x,y的值:def check(x, y): print(type(x)) print(type(y)) print(x) print(y) if x == y: print "Yes" 现在当我打电话check(1.00000000000000001, 1.0000000000000002)它正在打印:<…

Python:检查新文件是否在文件夹中[重复] - python

This question already has answers here: How do I watch a file for changes? (23个答案) 3年前关闭。 我是python的新手,但是我尝试创建一个自动化过程,其中我的代码将侦听目录中的新文件条目。例如,某人可以手动将zip文件复制到一个特定的文件夹中,并且我希望我的代码能够在文件完全…