在Eclipse中远程调试Python [英] Remote debugging Python in Eclipse

查看:73
本文介绍了在Eclipse中远程调试Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地Windows机器上安装了带有Pydev和RSE的Eclipse.我想远程调试在Ubuntu 16.04 VPS上托管的Python应用程序(Odoo 9.0).我在远程计算机上安装了Pydev.我已经可以使用身份验证密钥通过SSH连接到远程计算机,并且可以浏览远程文件系统.

I have Eclipse with Pydev and RSE installed on my local Windows machine. I want to remote debug a Python application (Odoo 9.0) that is hosted on an Ubuntu 16.04 VPS. I have Pydev installed on the remote machine. I have been able to connect to the remote machine via SSH using a key for authentication and I can browse the remote file system.

请参阅此处的文档; http://www.pydev.org/manual_adv_remote_debugger.html 并阅读位于的文件中的评论;/usr/local/lib/python2.7/dist-packages/pydevd_file_utils.py看来我需要将远程映射到本地文件系统.对我而言,这意味着代码必须同时存在于远程和本地(Eclipse)计算机上.如果是这种情况,如何使它们保持同步.我希望能够在远程计算机上使用我的代码库进行开发.我是否需要将所有更改都复制到本地计算机上?感觉好像我错过了难题的一部分,发现的文档还不够详细,无法实现.

Refering to the documentation here; http://www.pydev.org/manual_adv_remote_debugger.html and reading the comments in the file located at; /usr/local/lib/python2.7/dist-packages/pydevd_file_utils.py it would seem that I need to map remote to local file system. To me this implies that the code must exist on both the remote and local (Eclipse) machines. If this is the case, how do I keep them in sync. I want to be able to develop with my code base on the remote machine. Do I need to copy every change to my local machine? It feels like I'm missing part of the puzzle and the documention that I've found is not detailed enough to be able to implement.

请让我知道实现远程调试还有哪些步骤尚待解决,以及对我的工作流程有何影响(例如,必须将所有更改都复制到两个文件系统中).

Please let me know what steps remain outstanding to implement remote debugging and any implications for my workflow (such as having to copy all changes to both file systems).

推荐答案

如果您想远程(而不是本地)开发代码,我的建议是使用sshfs(因此,您可以直接在其中进行所有更改)

If you want to develop the code all remotely (instead of locally), my suggestion is using sshfs (so, you'd do all the changes there directly).

在这种情况下,您甚至还应该能够为远程解释器创建Shell脚本(即:解释器可以是任何脚本,因此,您可以将其chroot或什至通过ssh运行一些python).

You should even be able to create a shell script to a remote interpreter in that case too (i.e.: the interpreter may be any script, so, you could chroot it or even run some python through ssh).

请注意,我尚未实际测试过,但从理论上讲,它应该可以工作;)

Note I haven't actually tested this, but in theory it should work ;)

这篇关于在Eclipse中远程调试Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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