I have developed some code in Python using the eclipse perspective PyDev. The code includes imports.
When i run the code from within eclipse everything goes fine, but if i try executing: > python my_application.py -some_flag I get an error. The interpreter is unable to located one of the modules from which i import a class.
I am running from the python32 directory (since python.exe is not in my PATH) but provide the full path to my_application.py. my_application.py has imports from other .py files that declare classes that a I have written. all the .py files are in the same directory.
EDIT: Adding python.exe to the PATH and running the command above from the directory where my_application.py is placed made no effect.
What am i doing wrong?
Turns out one of the modules was not in the correct directory. Eclipse would run the program with no problem, since the module was in the same project. Python, on the other hand, couldn’t find the module and failed.
i Moved the module to the correct directory and it runs without any problem.