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

 

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