python脚本问题
我正在尝试运行 python 脚本,出现的错误是:
Traceback (most recent call last):
File "/opt/erange/geneMrnaCountsWeighted.py", line 266, in <module>
main(sys.argv)
File "/opt/erange/geneMrnaCountsWeighted.py", line 51, in main
options.extendGenome, options.replaceModels)
File "/opt/erange/geneMrnaCountsWeighted.py", line 250, in geneMrnaCountsWeighted
tagCount += tagValue / tagDenom
UnboundLocalError: local variable 'tagValue' referenced before assignment
任何人都可以帮助我吗?
I am trying to run a python script, the error that appear is:
Traceback (most recent call last):
File "/opt/erange/geneMrnaCountsWeighted.py", line 266, in <module>
main(sys.argv)
File "/opt/erange/geneMrnaCountsWeighted.py", line 51, in main
options.extendGenome, options.replaceModels)
File "/opt/erange/geneMrnaCountsWeighted.py", line 250, in geneMrnaCountsWeighted
tagCount += tagValue / tagDenom
UnboundLocalError: local variable 'tagValue' referenced before assignment
Anyone could help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您正在使用该特定脚本的旧版本。将旧版本与最新版本进行比较:
http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blob;f=geneMrnaCountsWeighted.py;hb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4
http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blob;f=geneMrnaCountsWeighted.py;h=74e7a0cd817e699af6b398960578f576a030f7e4;hb=HEAD
You're using an old version of that particular script. Compare the old version with the newest version:
http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blob;f=geneMrnaCountsWeighted.py;hb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4
http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blob;f=geneMrnaCountsWeighted.py;h=74e7a0cd817e699af6b398960578f576a030f7e4;hb=HEAD
这个错误:
表示变量
tagValue
在被赋值之前被使用,如下所示:在这种情况下,
c
在它之前被引用被分配了,所以Python不知道如何处理这个变量。UThis error:
Says that the variable
tagValue
was used before it was assigned a value, like this:In this case,
c
was referenced before it was assigned, so Python has no idea what to do with that variable.U看看这条线...
UnboundLocalError:赋值前引用局部变量“tagValue”
需要解释什么吗?
Have a look at the line...
UnboundLocalError: local variable 'tagValue' referenced before assignment
Need to explain anything?