PyCharm remote debugging issues working on code that launches bash script

Answered

 Hello,

I have the following situation:

PyCharm Professional 2017.1.1 installed under macOS Sierra and I'm developing on a remote server running Ubuntu 16.04 with miniconda and both python 2.7.12 and 3.6.0. I'm using remote server interpreters pointing to the python environments under the my remote miniconda folder.

The code I'm developing interacts with some shell scripts using popen and pipes.

If I run my code from the command line on the server and/or from the PyCharm IDE the popen commands work just fine and return the desired values.

However when I try to debug my code, the returned value is:

 ['<path to bash script>: line XY: /<my home folder>/.pycharm_helpers/pydev/pydevd.py: Permission denied', '']

The bash script permissions are set to 777, and as I mentioned, it works fine when I simply run the code but it doesn't when I run it in debug.

Any hep would be greatly appreciated.

Thanks.

0
4 comments

Hi! PyCharm saves util files for remote debugging in the folder '.pycharm_helpers' and in fact it runs the file 'pydevd.py' and runs user's code inside it. Try to change permissions for this script too.

0
Avatar
Permanently deleted user

Hi Elizabeth,

I need a clarification.

The current permissions on the file ~/.pycharm_helpers/pydev/pydevd.py are set to 644. what should I change them to?

Many thanks!

 

0

I can't answer to this question, because it depends on your environment. You should set permissions in order to be able to run this Python script on your machine.

0
Avatar
Permanently deleted user

Given that pydevd.py is a script, I assumed that simple standard read permissions would be enough... however I tried setting the permissions to 777 and I did get a step forward.

Now I get the following error:

["<my home folder>/.pycharm_helpers/pydev/pydevd.py: line 5: $'\\nEntry point module (keep at root):\\n\\nThis module starts the debugger.\\n': command not found", '']

I know the command I'm passing to my function exists (and it works when not in debug mode)...

The function causing the error is:

def _runProcess(exe):
"""
Runs the RGISpython.sh with the appropriate parameters
and returns the results
"""
p = sp.Popen(exe, stdout=sp.PIPE, stderr=sp.STDOUT)
while (True):
retcode = p.poll() # returns None while subprocess is running
line = p.stdout.readline()
yield line
if (retcode is not None):
break
0

Please sign in to leave a comment.