Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm remote debugging

I have remote Ubuntu server, and I'm trying set up remote debugging. Configured as shown 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)

I also connect remote host for synchronizing and uploading my python scripts to remote server. (Tools -> Deployment -> ...)

When I start debugging:

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

How to solve this problem?

like image 203
Dmitry Avatar asked Apr 19 '13 13:04

Dmitry


People also ask

What is remote debugging PyCharm?

Remote Debugging with PyCharm Last modified: 21 July 2022. Professional feature: download PyCharm Professional to try. With PyCharm you can debug your application using an interpreter that is located on the other computer, for example, on a web server or dedicated test machine.

How do I connect to a remote server with PyCharm?

Connect to a remote server and open the remote project Ensure you have the Remote Development Gateway plugin enabled. On the PyCharm welcome screen, select Remote Development. In the Run the IDE Remotely section, click SSH Connection.


1 Answers

The first argument of pydevd.settrace function should be the host, where PyCharm is installed. Not remote server. Also in most cases if you want to run and debug your code remotely it is more convenient to use remote interpreter feature.

like image 183
Dmitry Trofimov Avatar answered Sep 28 '22 04:09

Dmitry Trofimov