PyLint "Unable to import" error - how to set PYTHONPATH?

Posted by Evgeny on Stack Overflow See other posts from Stack Overflow or by Evgeny
Published on 2009-12-14T07:22:05Z Indexed on 2010/06/17 20:33 UTC
Read the original article Hit count: 259

Filed under:
|
|

I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie.

__init__.py
myapp.py
one.py
subdir\
    __init__.py
    two.py

Inside two.py I have import one and this works fine at runtime, because the top-level directory (from which myapp.py is run) is in the Python path. However, when I run PyLint on two.py it gives me an error:

F0401: Unable to import 'one'

How do I fix this?

© Stack Overflow or respective owner

Related posts about python

Related posts about pylint