【发布时间】:2012-01-06 21:41:00
【问题描述】:
每当我尝试在安装了 python 2.6.6 的 Windows 7 Enterprise(64 位)中运行这个 python 脚本时,我都会不断收到这个错误
问题签名: 问题事件名称:APPCRASH
应用程序名称:python.exe
应用程序版本:0.0.0.0
申请时间戳:4c73f7b6
故障模块名称:_csr.pyd
故障模块版本:0.0.0.0
故障模块时间戳:4d6a645b
异常代码:c0000005
异常偏移量:000c05d4
我尝试重新安装 python 和我的程序运行的所有模块(即 gensim、nlptk、scipy 和 numpy)
我不知道这对你们来说是否足够的数据,但请告诉我!!
lsi = models.LsiModel(corpus, num_topics = num_Topics)
index_lsi = similarities.MatrixSimilarity(lsi[corpus])
for k, v in dict_Queries.items():
File.write("Check Key: " +k+ "\n")
print "Running.... \n"
vec_bow = dict.doc2bow(v.split(), allow_update=True)
#In the last iteration, the code below the line doesn't run and i think the vec_lsi
#is the source of the problem but I don't know why?
vec_lsi = lsi[vec_bow]
#indexing the LSI
sims = index_lsi[vec_lsi]
sims = sorted(enumerate(sims), key = lambda item: -item[1])
if not cut_Off == 0:
sims = sims[0:cut_Off]
else:
pass
for t in sims:
dup_info = dict_tcs.get(t[0])
if t[1] > 0.75:
#print "Key: " + k + " Link: " + dup_info + "\n"
File.write("Adding: "+str(t)+ " To LSI actual \n")
if dict_Actual_LSI.has_key(k):
links = dict_Actual_LSI.get(k)
links.append(dup_info)
else:
links = []
links.append(dup_info)
dict_Actual_LSI[k] = links
print "Added\n"
在最后一次迭代中,该行下面的代码没有运行,我认为 vec_lsi 是问题的根源,但我不知道为什么?
谢谢
【问题讨论】:
-
有什么用吗?
print "hello world"有效吗? -
正是——例如,在命令行中尝试
python -c "print 'hello, world'" -
是的,这行得通,那么它在我的代码中吗?
-
是的。只是要明确一点:你是如何运行你的程序的?你是从命令行运行它吗?在这种情况下,您应该得到一个带有回溯的异常。
-
我正在从命令行运行它,但提示符上没有出现回溯....它只是用显示上述错误的外部屏幕来标记我