I have a file system as follows:
/
- website/
- - server.py
- common.py
When in /
, i try to run: python website/server.py
but it shows an error when attempting to from common import my_func
saying:
ImportError: No module named common
Is there a way to denote a file as a module? The issue I am running into is that while working in PyCharm it understands the python files correctly and functions as designed, but when running them in the command prompt in a VM it doesnt understand. I was running the python from / as you can see, thinking it would use that as the scope, but it seems like that isnt working.
I was not given any more information from the debugger or logs. What am I doing wrong?
Edit I tried doing the following as per Joao's request. python ./website/server.py
and returned the following line still, which is the same error received above.
Traceback (most recent call last):
File "./website/server.py", line 3, in <module>
from common import my_func
Import Error: No module named common