Hi, On 03 janvier 07:26, Monte Milanuk wrote: > I have been playing with Python recently on several different > platforms (Win Vista & 7, Ubuntu 12.04/12.10, running either regular > Python, python(x,y) or Portable Python, using either Spyder or PyDev > as editor) I selected pylint during the install process, and loaded up > a script from the code resources for 'Rapid GUI Development with > Python & Qt4'... specifically the first simple 'alert.pyw' from > chapter 4. > > Pylint is saying that this is an error: > > from PyQt4.QtCore import (QTime, QTimer, Qt, SIGNAL) > > ...and here is the error message: > > [E0611]19: No name 'QtCore' in module 'PyQt4' > > ...but in both the regular Python interpreter (2.7.3) and the ipython > interpreter (0.13) I can type in: > > from PyQt<tab>4.QtC<tab>ore > > and the auto-complete seems to find it just fine.
IIRC this is a long-standing bug related to how pyqt compiled modules are written and rely on a specific load order. This order is enforced by the package __init__.py or such, though this one is not loaded by pylint which doesn't load python file (only parses them to get an AST). Unfortunatly there is no easy fix on the pylint side without special casing for pyqt, which I would like to avoid. -- Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects