2013-04-19 16 views
5

Ho un server Ubuntu remoto e sto provando a configurare il debug remoto. Configurato come mostrato here.PyCharm debug remoto

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) 

Collego anche l'host remoto per la sincronizzazione e il caricamento dei miei script python sul server remoto. (Strumenti -> Distribuzione -> ...)

Quando inizio il debug:

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 

Come risolvere questo problema?

risposta

7

Il primo argomento della funzione pydevd.settrace deve essere l'host, in cui è installato PyCharm. Server non remoto. Inoltre, nella maggior parte dei casi, se si desidera eseguire e eseguire il debug del codice in remoto, è più comodo utilizzare remote interpreter feature.

+0

Ok. Ma non funziona anche: Impossibile connettersi a xx.xx.22.135: 51234 Traceback (ultima chiamata ultima): File "C: \ Programmi (x86) \ JetBrains \ PyCharm 2.7.1 \ helpers \ pydev \ pydevd_comm. py ", riga 428, in StartClient s.connect ((host, porta)) File" C: \ Python27 \ Lib \ socket.py ", riga 224, nella metrica return getattr (self._sock, name) (* args) errore: [Errno 10060] – DevellMen

+0

Leggere la mia modifica. –

+0

Quale porta stai eseguendo il tuo server di debug remoto? –