There are many questions about "unresolved import" for Python with PyDev in Eclipse. NB Linux Mint 18.3 OS, Python3, Eclipse "2019-06", PyDev 7.3.0...
I just hoped someone might be able to confirm my understanding on this:
Directory structure:
project directory: PyDevExp
directory: mygame
file: draw.py
file: game.py
game.py looks like this:
# game.py
# import the draw module
import draw
def play_game():
...
def main():
result = play_game()
draw.draw_game()
if __name__ == '__main__':
main()
When I run this at the command line:
python3 game.py
... it runs fine, no complaints. But when I view it in Eclipse there's a horrid red mark next to the import line. I can only get rid of it by adding directory "mygame" to the project's PYTHONPATH.
Surely this is ridiculous? Why can't PyDev "see" other files in the same directory without this having to be explicitly configured? Or am I doing something wrong?
later
The thing even runs OK in Eclipse! So for now I've changed the notification level from "error" to "info" for Windows --> Prefs --> PyDev --> Editor --> Code Analysis --> Imports tab --> "Import not found".
Unsatisfactory!
