简体   繁体   English

pydev远程调试路径

[英]pydev remote debug path

I want to use eclipse, pydev to remote debug my python script. 我想使用Eclipse,Pydev远程调试我的python脚本。 Python script is on a remote Ubuntu server, and Eclispe/pydev is running on my Windows 7 machine. Python脚本位于远程Ubuntu服务器上,而Eclispe / pydev正在Windows 7计算机上运行。

I followed every step according to this one. 我按照这一步骤进行了每一步。 http://pydev.org/manual_adv_remote_debugger.html http://pydev.org/manual_adv_remote_debugger.html

The problem is in the last step of configuring path in pydevd_file_utils.py on server, it does not recognize the change. 问题出在服务器上pydevd_file_utils.py中配置路径的最后一步,它无法识别更改。 This is what I changed: 这是我更改的内容:

PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'c:\EZ_Green\plugins', r'/home/jiechao/EZ_Green/plugins')]

When I run the script, it gives me such error. 当我运行脚本时,它给了我这样的错误。

pydev debugger: warning: trying to add breakpoint to file that does not exist: /home/jiechao/EZ_Green/plugins/D:/EZ Green/backend/getData.py (will have no effect)

Seems the change does not apply, has anyone done this before or have any ideas? 似乎该更改不适用,是否有人曾经这样做或有任何想法?

Thanks a lot 非常感谢

-----------------update 1-------------- -----------------更新1 --------------

So I solve the previous problem and now here is the new problem. 所以我解决了之前的问题,现在是新的问题。

This is the output of program, and it seems the path configuration is correct. 这是程序的输出,似乎路径配置正确。 Debug Server at port: 5678 pydev debugger: replacing to server: D:\\EZ Green\\Product\\EZ_Green\\plugins\\test.py pydev debugger: sent to server: /home/jiechao/EZ_Green/plugins\\test.py pydev debugger: replacing to client: /home/jiechao/EZ_Green/plugins/test.py pydev debugger: sent to client: D:\\EZ Green\\Product\\EZ_Green\\plugins/test.py 端口上的调试服务器:5678 pydev调试器:替换为服务器:D:\\ EZ Green \\ Product \\ EZ_Green \\ plugins \\ test.py pydev调试器:发送至服务器:/home/jiechao/EZ_Green/plugins\\test.py pydev调试器:替换到客户端:/home/jiechao/EZ_Green/plugins/test.py pydev调试器:发送到客户端:D:\\ EZ Green \\ Product \\ EZ_Green \\ plugins / test.py

But eclipse does not stop at the breakpoint, not even at pydevd.settrace() I have no idea why it does not stop. 但是eclipse不会在断点处停止,甚至不会在pydevd.settrace()处停止,我也不知道为什么它不会停止。 When I use remote debug on local machine, it works pretty well. 当我在本地计算机上使用远程调试时,它运行良好。 When I want to debug on a remote server machine, it does not work. 当我想在远程服务器上调试时,它不起作用。 I don't know what's the problem. 我不知道出什么问题了。

------------------update 2--------------------- ------------------更新2 ---------------------

Problem solved. 问题解决了。 The script on my client and server turns out to be a little different. 我的客户端和服务器上的脚本有些不同。 So I did not see the breakpoint it stopped. 所以我没有看到断点停止了。 I am so stupid! 我好笨!

Thanks anyway. 不管怎么说,还是要谢谢你。

Even though it is possibly not the exact approach you may expect, one option is to start the Unittest from the command line and attach the debugger by RemoteDebugServer via 'pydevd.py'. 即使这可能不是您期望的确切方法,一种选择是从命令行启动Unittest,然后通过RemoteDebugServer通过“ pydevd.py”附加调试器。

This is now a fully automated option of ePyUnit which includes the automation of remote debugging with PyDev and Eclipse by 'pydevd.py'. 现在,这是ePyUnit的全自动选项,其中包括通过“ pydevd.py”使用PyDev和Eclipse进行远程调试的自动化。 This works seamlessly for 'subprocesses' as well as independently started command line processes. 这对于“子流程”以及独立启动的命令行流程均无缝运行。

The hostame and the port number could be varied as required, default is localhost:5678 . 主机名和端口号可以根据需要进行更改,默认值为localhost:5678

See: 看到:

For basics of remote debugging: 有关远程调试的基础知识:

Also enhanced unittest integration into PyUnit. 还增强了将单元测试集成到PyUnit中的功能。

Comments and fixes are welcome. 欢迎评论和修复。

Have fun. 玩得开心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM