无法让Netbeans调试器工作在python [英] Unable to get Netbeans debugger working for python

查看:233
本文介绍了无法让Netbeans调试器工作在python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ubuntu 9.10
Netbeans 6.7.1



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



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



我还注意到,PythonConsole窗口报告说,无论项目属性中选择的版本如何,Python 2.5.0+都可以运行。



感谢任何帮助,我被困了。

  [LOG] PythonDebugger:整体起始
[LOG] PythonDebugger.taskStarted:I我开始一个新的调试会话...
[LOG]这个窗口是一个交互式调试上下文感知Python Shell
[LOG]你可以在调试时输入python控制台命令
线程MainThread中的异常:
追溯(最近的最后一次调用):
文件/usr/lib/python2.5/threading.py,第486行,__bootstrap_inner
self.run()
调试会话规范al end
文件/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py,第590行,运行
exec self._cmd in self._myglobals,self ._mylocals
文件< string>,第1行,< module>
文件/ media / Docs_ / MyDocuments / sites / Machine Inteligence / Code / MachineInteligence / src / machineinteligence.py,第1行在< module>
__author __ =sky
文件/ media / Docs_ / MyDocuments / sites / Machine Inteligence / Code / MachineInteligence / src / machineinteligence.py,第1行在< module>
__author __ =sky
文件/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py,第724行,trace_dispatch
self.dispatchLineAndBreak (mainDebugger,frame,lthread)
文件/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py,第604行,在dispatchLineAndBreak
lthread.additionalInfo.breakHere (frame,lthread)
文件/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py,第810行,breakHere
while(self.dbg.parseSubCommand (self.dbg._connection.getNextDebuggerCommand(),frame,lthread)== FREEZE):
文件/home/sky/.netbeans/6.7/config/nbPython/debug/nbpythondebug/jpydaemon.py,行1452,在parseSubCommand
hits = int(hits)
ValueError:对于int()的无效字面值为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 =无
JPyDbg连接本地主机在= 29100 / out = 29100
JPyDbgI0001:连接到本地主机
/ pre>

解决方案

我也遇到过Netbeans Python调试器的一些问题。 Netbeans中的Python支持还不是很完美,不会靠近Java Netbeans性能和支持。



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



此外,尝试删除似乎混淆调试器的__作者__行,并记住通常Netbeans调试器在脚本中的第一行设置自动断点,这有时导致我认为它是挂起,而只是等待我告诉它继续。



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



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


Ubuntu 9.10 Netbeans 6.7.1

Whenever I start the debugger it crashes out with the error below.

I've set the project properties to the correct version of python, although it doesn't seem to make any difference what it is set to.

I've also noticed that the PythonConsole window reports that Python 2.5.0+ is running regardless of the version that is selected in the project properties.

Be grateful for any help, I'm stumped.

[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

解决方案

I've experienced some issues with the Netbeans Python debugger as well. Python support in Netbeans is not yet perfect and does not come anywhere near to Java Netbeans peformance and support.

You could try checking python platforms in Tools -> Python Platforms; try removing and readding the interpreter, thus forcing library reloading.

Also, try removing the __ author __ line which seems to confuse the debugger, and remember that usually the Netbeans debugger sets an "automatic breakpoint" at the first possible line in the script, and this sometimes led me to think it was "hung" while it was just waiting for me to tell it to continue.

If you just need a debugger, and you don't strictly need to use Netbeans, I'd advise you to try Winpdb (standalone crossplatform debugger, despite the name), which works very good even tough it doesn't support watches and requires a minimum of tinkering with PYTHONPATH in order to run your projects; or you could use Eclipse+Pydev; while I'm not a huge Eclipse fan, I think the Pydev its debugger simply works great.

Commercial IDEs support other debuggers, but I think they'd be out of the scope of your question.

这篇关于无法让Netbeans调试器工作在python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆