PyCharm remote debugging

I have a remote Ubuntu server and am trying to configure 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 the remote host to synchronize and upload my python scripts to the 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?

+5
source share
1 answer

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

+7
source

All Articles