无法让Netbeans调试器为python工作

时间:2009-12-28 23:14:00

标签: python netbeans ubuntu debugging

Ubuntu 9.10 Netbeans 6.7.1

每当我启动调试器时,它都会因以下错误而崩溃。

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

我还注意到PythonConsole窗口报告Python 2.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

4 个答案:

答案 0 :(得分:2)

我也遇到过Netbeans Python调试器的一些问题。 Netbeans中的Python支持还不完善,并且不会接近Java Netbeans的性能和支持。

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

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

如果您只需要一个调试器,并且您不需要使用Netbeans,我建议您尝试Winpdb(独立的跨平台调试器,尽管名称),这非常好,甚至很难不支持手表,并且需要至少修补PYTHONPATH才能运行您的项目;或者你可以使用Eclipse + Pydev;虽然我不是一个巨大的Eclipse粉丝,但我认为Pydev的调试器效果很好。

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

答案 1 :(得分:0)

有人提到项目路径中的空格会导致此错误(对于我来说,Kubuntu 13.10和Netbeans 7.4问题在路径中的消除空间之后仍然存在)

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

答案 2 :(得分:0)

可能你在文件的路径中使用过空格(发生在我身上)

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

答案 3 :(得分:0)

I had this same problem today. Renaming the folder my code was in to have no spaces didn't help. The parent folder was the only folder in the code's file path that had spaces in it.

The only thing that worked for me was to make a new folder with the correct name (without spaces) and move all my code into that. Once I did this, debugging was then possible.