gpt4 book ai didi

python - PyCharm 远程调试

转载 作者:太空狗 更新时间:2023-10-29 23:55:02 25 4
gpt4 key购买 nike

我有远程 Ubuntu 服务器,我正在尝试设置远程调试。如图配置here .

import sys
import pydevd
sys.path.append('/root/home/scripts/pycharm-debug.egg')
pydevd.settrace('my_remote_server_IP', port=51234,
stdoutToServer=True, stderrToServer=True)

我还连接远程主机以将我的 python 脚本同步并上传到远程服务器。 (工具 -> 部署 -> ...)

当我开始调试时:

C:\Python27\python.exe C:/Projects/python/demo.py
Could not connect to xx.xx.xx.166: 51234
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.1\helpers\pydev\pydevd_comm.py", line 428, in StartClient
s.connect((host, port))
File "C:\Python27\Lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 10061] ����������� �� �����������,

Process finished with exit code 1

如何解决这个问题?

最佳答案

pydevd.settrace 函数的第一个参数应该是安装 PyCharm 的主机。不是远程服务器。同样在大多数情况下,如果您想远程运行和调试代码,使用 remote interpreter feature 会更方便。 .

关于python - PyCharm 远程调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16105337/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com