New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pylint doesn't find relative imports #795
Comments
Can you give more details about this, what code did you use, how did you call pylint? I tried with a demo skeleton and it works just fine. |
I just found out that it's a problem with my IDE, not with Pylint itself — I will report it there. Thanks for helping! |
My IDE is running Pylint while the file is still unsaved, and for that reason, the IDE is copying the file into a temporary directory. That's the reason Pylint doesn't find the relative imports. Is there any parameter I could use, to tell Pylint the actual location of the file, or does Pylint support read from stdin? |
Hmm, no, pylint doesn't use the stdin for this, but I'm not sure there's anything we could do here if your files are in a temporary directory, which don't contain the respective imported modules. |
There's nothing we can do here, I'm afraid. |
Seems like an wrapper for pylint (linter-pylint) for the Atom (text editor) has the same issue. The point is that it works in pylint<1.5.0. |
They have the following situation. To lint a file, they firstly copy it to a temporary directory.
My PYTHONPATH contains The point is that according to this it should work. And it's working with pylint<1.5.0. But with with pylint 1.5+ I receive the error described above. Update: and @PCManticore Could you help to figure out the problem and find a workaround to this? Maybe is something wrong with PYTHONPATH. |
I have exactly the same problem. The issue might come from the fact that:
|
I just pull requested a feature that would solve this issue: #881 |
When using relative imports like
I get these two errors:
The text was updated successfully, but these errors were encountered: