python-language-server
python-language-server copied to clipboard
'No parent module' error
I am having a strange issue with a false positive error.
I have a typical Python3 project with setup.py and the package directory, with all modules inside and, obviously, the __init__.py file.
Whenever I try to import a sibling module, in the form of from . import module, I got the error No parent module -- cannot perform relative import. If things are imported from the module in the form of from .module import func, everything is fine.
From the logs I can see that the error is obtained by pycodestyle. However, I tried to run the tool from the shell, and the error is not shown.
I am using NeoVim with LanguageClient-neovim, if it could be relevant.
I got this error too.
I suspect the internal call to pycodestyle strips away the remaining project context and thus this error appears.
I think it's caused by the pyls-mypy plugin. See the issue I reported there: https://github.com/tomv564/pyls-mypy/issues/36.