我正在尝试在Intellij中调试python文件。在平台设置 - SDKs 下的项目结构中,只有一个Python SDK,它是本地的(位于我的HD上)。
当我调试python文件时,我注意到在控制台输出中它正在调用 pydevd.py ,将127.0.0.1(localhost)作为客户端传递,并将55723作为端口传递。
据我了解,pydevd.py用于远程调试python。我遇到的问题是,在我结束程序的执行后,我正在调试,或者它自己完成,我必须等待2-5分钟才能尝试调试甚至运行程序,因为我会收到此错误:socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
我在 Windows 7企业版上使用 Intellij IDEA 15.0.4 。
调试时打印到控制台的完整调试命令和结果回溯(删除了工作文件名):
C:\Python27\python.exe C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydevd.py --multiproc --qt-support --client 127.0.0.1 --port 55723 --file C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pycharm\utrunner.py {path to python file}::{python class to run} true
Testing started at 3:26 PM ...
pydev debugger: process 12384 is connecting
Connected to pydev debugger (build 143.2287)
Traceback (most recent call last):
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydevd.py", line 2403, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydevd.py", line 1794, in run
launch(file, globals, locals) # execute the script
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pycharm\utrunner.py", line 129, in <module>
module = loadSource(a[0])
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pycharm\utrunner.py", line 41, in loadSource
module = imp.load_source(moduleName, fileName)
File "{some python file}", line 20, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 12, in <module>
__import__(modname)
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 17, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 23, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 17, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 21, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 15, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 20, in <module>
from {some python class} import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "{some python file}", line 21, in {some python class}
import {some python class}
File "C:\Users\stmcdonald\.IntelliJIdea15\config\plugins\python\helpers\pydev\pydev_monkey_qt.py", line 71, in patched_import
return original_import(name, *args, **kwargs)
File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\__init__.py", line 555, in <module>
_populateNamespace(globals())
File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\__init__.py", line 227, in _populateNamespace
for method in client._client.system.listMethods():
File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1575, in __request
verbose=self.__verbose
File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 136, in request
self.send_content(h, request_body)
File "C:\Python27\lib\xmlrpclib.py", line 1439, in send_content
connection.endheaders(request_body)
File "C:\Python27\lib\httplib.py", line 951, in endheaders
self._send_output(message_body)
File "C:\Python27\lib\httplib.py", line 811, in _send_output
self.send(msg)
File "C:\Python27\lib\httplib.py", line 773, in send
self.connect()
File "C:\Python27\lib\httplib.py", line 754, in connect
self.timeout, self.source_address)
File "C:\Python27\lib\socket.py", line 571, in create_connection
raise err
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
我可以做些什么来理想地停止使用pydevd.py尝试远程调试我的本地文件,在我的本地解释器上,或者我该怎么办才能停止获取[Errno 10061]
?