I am hoping someone could shine some light on a really odd situation I am running into today. I have a project I completed that runs great in PyCharm; however, when trying to call the project from the command line, this is the error I am receiving:
[root@vodgsnxf-po-a2p ~]# python /opt/gsnworkflow/GSNEventLoop/EventLoop.py
Traceback (most recent call last):
File "/opt/gsnworkflow/GSNEventLoop/EventLoop.py", line 6, in <module>
from Modules import FileOperations
ImportError: No module named Modules
Here is my file layout:
/opt/gsnworkflow/
|-- __init__.py
|-- GSNEventLoop/
| |-- __init__.py
| `-- EventLoop.py
`-- Modules/
|-- __init__.py
|-- Configuration.py
|-- Logging.py
|-- FileOperations.py
`-- Database.py
I have tried a bunch of different sys.path.append
commands, such as the following:
sys.path.append('/opt/gsnworkflow/')
sys.path.append('/opt/gsnworkflow/Modules/')
sys.path.append('/opt/gsnworkflow/GSNEventLoop/')
None of these options have resolved my issue at all and I am getting to my wit's end. Does anyone see anything glaringly obvious that I may have missed or done incorrectly? I truly appreciate anyone who can figure this out. Thanks!