I have written a small script in Python with Eclipse, and it works when executed from Eclipse. But it doesn't work from command line:
>python test.py argument1 argument2
from src import Tests, ImportError: No module named src
The script is stored with the following folders:
ScriptFolder
.input
.report
.src
..test.py
..Tests
...Test1.py
...Test2.py
..TestUtils
...FileUtils.py
And this is the way I'm doing the imports at test.py:
from src import Tests
from TestUtils import FileUtils
About the init.py files, the one which shares folder with test.py is empty, and the one into Tests folder has this content:
import Test1
import Test2
And the init.py file into TestUtils has this content:
import FileUtils
The problem is that, if I change the line from src import Tests to just import Tests I'm getting error in Eclipse: Unresolved imports: Tests. found at src.Tests
How can I make it work for both Eclipse and command line?