So. I'm aware that this question seems to have been asked to death, but none of the answers seem to address what I want to do.
I have a library in another directory that I want to include in a set of other projects that I run. I don't want that library added every time I run python..
So, what I had been doing was this in my python code:
import sys
sys.path.append("/tmp/demo/src/my-lib")
import MyClass
and this worked fine. But, now that I've discovered and love pylint, it complains that
E: 7, 0: Unable to import 'MyClass' (import-error)
C: 7, 0: Import "import MyClass" should be placed at the top of the module (wrong-import-position)
I know I could just disable import-error and wrong-import-position with a directive (or just by putting it into .pylintrc...) But, I'd rather not. I'd like to know the "right" way of adding a path to sys.path that's not global to all my projects, just to the subset of projects that use that particular library.
Is this possible?