PyDev远程调试不工作(连接拒绝) [英] PyDev remote debugging not working (connection refused)

查看:711
本文介绍了PyDev远程调试不工作(连接拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ArchLinux(Manjaro)机器上使用Eclipse Luna Service Release 1(4.4.1)与PyDev 3.9.0.201411111611进行Python 2.7开发。



我有一个外部脚本从命令行运行我的应用程序,使用 import pydevd; pydevd.settrace()模板,如 docs 中所述,用于远程调试。 / p>

完整的脚本如下:

 #!/ 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()
除了例外为e:
print e
print>>>>>>>>错误!!!无法附加到python调试器

打印** 50
打印运行myapp从源
打印** 50
main(sys.argv [1:])

当我从命令行调用myapp时,异常从 settrace()抛出,但脚本停止该行和几分钟后拒绝与服务器的连接。这是完整的追溯:

 无法连接到127.0.0.1:5678 
追溯(最近呼叫最后) :
文件/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,第484行,在StartClient
s.connect((host,port))
文件/usr/lib/python2.7/socket.py,行224,in meth
return getattr(self._sock,name) (* args)
错误:[Errno 111]连接拒绝

PyDev远程调试器是正确地在Eclipse中启动,在localhost上使用端口5678。



有没有什么我在做错?

$ b $我有同样的问题,并且eclipse在升级了Aptana和pydev后无法进入python调试器。



我不得不在我的Ubuntu 14.04机器上打开防火墙端口。



虽然这不是最好的wa y,事情开始工作了。



sudo ufw allow 5678



在我做这个之前,内置的还被强调现在,pydev能够解决诸如True,max和None这样的事情。


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

I have an external script to run my application from command line, using the import pydevd; pydevd.settrace() template as described in the docs for remote debugging.

The full script is as follows:

#!/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 settup when I call myapp from command line no exception is thrown from settrace(), but the script halts on that line and after a couple of minutes refuses the connection 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 is correctly started inside Eclipse, at localhost using the port 5678.

Is there something I'm doing wrong?

解决方案

I had the same problem and eclipse was not able to get to the python debugger after I upgraded Aptana and pydev.

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

While this is not the best way, things started working again.

sudo ufw allow 5678

Builtin's were also being highlighted before I did this, now pydev is able to resolve such things as True, max and None.

这篇关于PyDev远程调试不工作(连接拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆