I'm having an issue with debugging a remote script. When starting the debugger, the debugger stops with an ImportError, because it can't find the modules imported by the script. Here's the traceback shown in the debugger:
ssh://n7@dmai:/opt/itinerator/pyre/bin/python -u /home/n7/.pycharm/pycharm_helpers/pydev/pydevd.py --client '0.0.0.0' --port 41016 --file /home/n7/dm/src/lib/datamap/classify.py
pydev debugger: starting
Connected to pydev debugger (build 117.663)
Traceback (most recent call last):
File "/home/n7/.pycharm/pycharm_helpers/pydev/pydevd.py", line 1401, in <module>
debugger.run(setup['file'], None, None)
File "/home/n7/.pycharm/pycharm_helpers/pydev/pydevd.py", line 1055, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "/home/n7/dm/src/lib/datamap/classify.py", line 12, in <module>
from common.pyutils import log_warn, log_debug
ImportError: No module named common.pyutils
Checking sys.path while the script is running shows that it indeed does not have the correct paths loaded. My profile on the remote server has a custom .bashrc that augments the PYTHONPATH with the correct paths - Pycharm obviously doesn't respect that. Shouldn't be a problem, though, because the Configuration settings for the remote interpreter that I set up have an Environment Variables section... so I just added the correct PYTHONPATH variable there. However, this is apparently being ignored, because it has no effect.
This problem means I can't debug remote scripts. What am I missing? How do I get the remote script to run with the correct PYTHONPATH?