无法使Netbeans调试器为python工作

2024-06-29 01:05:02 发布

您现在位置:Python中文网/ 问答频道 /正文

Ubuntu 9.10 Netbeans 6.7.1

每当我启动调试器时,它就会崩溃,并出现以下错误。在

我已经将项目属性设置为python的正确版本,尽管它的设置似乎没有任何区别。在

我还注意到PythonConsole窗口报告python2.5.0+正在运行,而不管在项目属性中选择的版本是什么。在

感谢你的帮助,我被难住了。在

[LOG]PythonDebugger : overall Starting
[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell 
[LOG]where you can enter python console commands while debugging 
Exception in thread MainThread:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
self.run()
Debug session normal end
  File "/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py", line 590, in run
exec self._cmd in self._myglobals,self._mylocals
  File "<string>", line 1, in <module>
  File "/media/Docs_/MyDocuments/websites/Machine Inteligence/Code/MachineInteligence/src/machineinteligence.py", line 1, in <module>
__author__="sky"
  File "/media/Docs_/MyDocuments/websites/Machine Inteligence/Code/MachineInteligence/src/machineinteligence.py", line 1, in <module>
__author__="sky"
  File "/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py", line 724, in trace_dispatch
    self.dispatchLineAndBreak(mainDebugger, frame , lthread )
  File "/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py", line 604, in dispatchLineAndBreak
    lthread.additionalInfo.breakHere(frame,lthread)
  File "/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py", line 810, in breakHere
    while ( self.dbg.parseSubCommand(  self.dbg._connection.getNextDebuggerCommand() , frame , lthread ) == FREEZE ):
  File "/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py", line 1452, in parseSubCommand
    hits = int(hits)
ValueError: invalid literal for int() with base 10: ''
/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py
args =  ['/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py', 'localhost', '29100']
localDebuggee= None
JPyDbg connecting  localhost  on in=  29100 /out= 29100
JPyDbgI0001 : connected to  localhost

Tags: inpydebugselflogconfighomeline
3条回答

可能你在你的文件路径中使用了空格(碰巧是我)

https://netbeans.org/bugzilla/show_bug.cgi?id=175116

有人提到project path中的空格会导致这个错误(但是对于我来说,在kubuntu13.10和netbeans7.4中,在从路径中删除空格之后,问题仍然存在)

https://netbeans.org/bugzilla/show_bug.cgi?id=196842

我在netbeanspython调试器方面也遇到了一些问题。Netbeans中对Python的支持还不够完善,与javanetbeans的性能和支持还差得远。在

您可以尝试在“工具”>;“python平台”中检查python平台;尝试删除并读取解释器,从而强制重新加载库。在

另外,请尝试删除似乎会混淆调试器的uuAuthor行,并记住,通常Netbeans调试器会在脚本的第一个可能的行设置一个“自动断点”,这有时会让我认为它是“挂起”的,而它只是在等待我告诉它继续。在

如果您只需要一个调试器,而且您并不严格需要使用Netbeans,我建议您尝试Winpdb(独立的跨平台调试器,尽管它的名称是什么),它工作得非常好,甚至很难——它不支持监视,并且需要对PYTHONPATH进行最小程度的修改才能运行您的项目;或者您可以使用Eclipse+Pydev;而我不支持作为一个巨大的Eclipse粉丝,我认为Pydev的调试器工作得很好。在

商业IDE支持其他调试器,但我认为它们不在您的问题范围之内。在

相关问题 更多 >