PyDev remote debugging not working (connection refused)

I am using Eclipse Luna Service Release 1 (4.4.1) with PyDev 3.9.0.201411111611 for Python 2.7 development on ArchLinux machine (Manjaro).

I have an external script to run my application from the command line using a template import pydevd; pydevd.settrace()

as described in the docs for remote debugging.

The complete script looks like this:

#!/usr/bin/python2
import sys

sys.path.append('/home/manu343726/Documentos/myapp/')
sys.path.append('/home/manu343726/.eclipse/org.eclipse.platform_4.4.1_1543616141_linux_gtk_x86_64/plugins/org.python.pydev_3.9.0.201411111611/pysrc/')

from mymodule import main

try:
    import pydevd;pydevd.settrace()
except Exception as e:
    print e
    print ">>>>>>>>ERROR!!! Could not attach to python debugger"

print "*"*50
print "running myapp from source"
print "*"*50
main(sys.argv[1:])

      

With this setup, when I call myapp from the command line, the exception is thrown from settrace()

, but the script stops at that line and after a couple of minutes it refuses to connect to the server. This is the complete traceback:

Could not connect to 127.0.0.1: 5678
Traceback (most recent call last):
  File "/home/manu343726/.eclipse/org.eclipse.platform_4.4.1_1543616141_linux_gtk_x86_64/plugins/org.python.pydev_3.9.0.201411111611/pysrc/pydevd_comm.py", line 484, in StartClient
    s.connect((host, port))
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 111] Connection refused

      

The PyDev remote debugger starts correctly in Eclipse on localhost using port 5678.

Is there something I am doing wrong?

+3


source to share


1 answer


I had the same problem and eclipse was unable to get to the python debugger after I updated Aptana and pydev.

I had to open a firewall port on my Ubuntu 14.04 machine.

Until this is the best way, everything worked again.



sudo ufw allow 5678

Builtin was also highlighted before I did this, pydev can now allow things like True, max and None.

+3


source







All Articles