In Pycharm CE I imported the project like this:
|- MyFramework
|- __init__.py
|- AutomationFramework
|- __init__.py
|- File_1.py
|- MainClass.py
and file_1 contends:
import AutomationFramework.MainClass as MainClass
def test_my_iot():
mc = MainClass.MainClass()
And it works when I double click in file1 and select "Run"
but using command lines is not working:
MyFramework $ python AutomationFramework/isolated_test_1.py
Traceback (most recent call last):
File "AutomationFramework/isolated_test_1.py", line 3, in <module>
import AutomationFramework.MainClass as MainClass
ImportError: No module named AutomationFramework.MainClass
MacPC:MyFramework $
I assume that I need to define the root of the project or something like that, but I really search around and I cannot found out what is wrong.
What PyCharm CE is working and with the terminal is not?
(edited to add the init.py that could have been the reason ).