python RuntimeError:cannot join current thread

一、问题提出

在运行程序的时候老是会报错

RuntimeError:cannot join current thread

二、问题解决

定位到你安装的tqdm包,一般都是安装在site-packages/tqdm中,然后找到_monitor.py文件,打开在以下内容中做出修改

from threading import Event,Thread,current_thread #第一行修改为这样
.
.
.
def exit(self):                                   #50行之后的exit函数修改为这样
        self.was_killed.set()
        if self is not current_thread():
            self.join()
        return self.report()

 

 

参考链接:https://blog.csdn.net/qq_38806886/article/details/89495639

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章