Following PEP8 recommendation about imports, import
statements should be absolute :
Standard library code should avoid complex package layouts and always use absolute imports.
# project/
# |---- __init__.py
# |---- employee.py
from .employee import Employee # <- BAD
from project.employee import Employee # <- Good
pip install pylint_absolute_imports
In pylint.rc
:
[MASTER]
load-plugins=pylint_absolute_imports
Or, in terminal:
pylint --load-plugins pylint_absolute_imports foo.py