I just wasted 2 hours trying to get pylint to recognise modules imported from local paths, but finally got it working.
I added the root to "python.autoComplete.extraPaths" but that only affected autocompletion, not pylint!
For that I had to install the project in the virtualenv.
First things first, make sure you are pointing to the interpreter in your virtualenv. Here is what my VSCODE workspace settings look like:
{
"python.linting.pylintEnabled": true,
"python.pythonPath": "/home/andrew/virtualenvs/eks/bin/python",
"python.linting.pylintPath": "/home/andrew/virtualenvs/eks/bin/pylint",
"python.autoComplete.extraPaths": ["/other/repos/eks"],
"python.linting.pylintArgs": [
"--disable=C0111", // missing docstring
"--load-plugins=pylint_django"
],
}
Second, with the virtualenv active, install the current directory as symlink like so:
pip install -e .
For the project to be installable, you need a setup.py file, which need only look like this:
from setuptools import setup
setup()
Of course you can use the setup mechanism with a setup.cfg file to control dependencies, but if you're having this problem then you are most likely not doing that in your project, so the above is the minimum you need to get it to work.
And of course, it all makes sense. How was pylint pointed to the python interpreter in your virtualenv supposed to know about a rot directory elsewhere?