[Python-projects] PyLint: Bogus message "Unable to import"

Alexandre Fayolle alexandre.fayolle at logilab.fr
Wed Jul 5 09:22:34 CEST 2006


On Mon, Jul 03, 2006 at 10:57:24AM +0200, Markus Meyer wrote:
> Hi everyone,
> 
> first, thanks for PyLint, which has helped me a lot in the past to find
> bugs in my code.
> 
> I got a problem with imports (confirmed in versions PyLint 0.11 and
> 0.8.1). Say I have the following code:
> 
> sys.path.append('/some/absolute/path/where/mylib/is/stored')
> from mylib import somemodule
<snip> 
> Any ideas on how to work around this? Is this a bug?

It is not a bug, it is a feature. Pylint does not take into account
changes to sys.path. Change your PYTHONPATH environment variable before
launching pylint, so that it is able to find the modules you import. 

-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20060705/59e4cd9d/attachment.pgp


More information about the Python-Projects mailing list