gpt4 book ai didi

python - pylint PyQt4错误

转载 作者:太空宇宙 更新时间:2023-11-03 19:38:42 26 4
gpt4 key购买 nike

我写了一个程序:

from PyQt4.QtCore import *
from PyQt4.QtGui import *

def main():
app = QApplication([])
button = QPushButton("hello?")
button.show()
app.exec_()

if __name__=="__main__":
main()

文件名为t.py,当我运行时:

pylint t.py

在ubuntu9.10、pyqt4、我得到了这个:

pylint t.py
No config file found, using default configuration
error while building astng for /home/halida/data/workspace/test/t.py
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 126, in astng_from_file
astng = ASTNGBuilder(self).file_build(filepath, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 118, in file_build
node = self.string_build(data, modname, path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 128, in string_build
return self.ast_build(parse(data + '\n'), modname, path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 147, in ast_build
self.rebuilder.walk(node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 89, in walk
self._walk(node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 109, in _walk
self._walk(child, node)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 103, in _walk
handle_leave = node.accept(self)
File "/usr/lib/pymodules/python2.6/logilab/astng/nodes.py", line 159, in accept
return func(self)
File "/usr/lib/pymodules/python2.6/logilab/astng/rebuilder.py", line 188, in visit_from
imported = node.root().import_module(node.modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/scoped_nodes.py", line 282, in import_module
return MANAGER.astng_from_module_name(self.relative_name(modname, level))
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 172, in astng_from_module_name
return self.astng_from_module(module, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/manager.py", line 207, in astng_from_module
astng = ASTNGBuilder(self).module_build(module, modname)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 80, in module_build
node = self.inspect_build(module, modname=modname, path=path)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 95, in inspect_build
self.object_build(node, module)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 195, in object_build
self.object_build(class_node, member)
File "/usr/lib/pymodules/python2.6/logilab/astng/builder.py", line 198, in object_build
object_build_methoddescriptor(node, member)
File "/usr/lib/pymodules/python2.6/logilab/astng/raw_building.py", line 150, in object_build_methoddescriptor
func = build_function(member.__name__, doc=member.__doc__)
AttributeError: 'PyQt4.QtCore.pyqtSignal' object has no attribute '__name__'
************* Module t
F: 1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>: Unable to load module t ('PyQt4.QtCore.pyqtSignal' object has no attribute '__name__')

Compilation exited abnormally with code 1 at Sat Dec 26 10:43:54

在 Windows XP 中,使用 pythonxy,

我只收到一条错误消息,为什么?

最佳答案

看起来像是 astng 中的错误。他们尝试读取未发布的函数的名称( native 扩展 func)。我会向 astngpyqt 项目报告错误。第一个是他们应该更好地处理无名情况。第二个是每个正常的扩展都应该至少发布函数名称。

关于python - pylint PyQt4错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1962500/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com