admin管理员组

文章数量:1558696

在google colab 的命令行执行程序,一直报cannot schedule new futures after interpreter shutdown

之前在别的服务器上就没事

程序的执行顺序

run.py  > importlib.import_module(需要执行的文件) > 传给 threading.Thread 

在importlib.import_module(需要执行的文件) 这一步里,用到了

from concurrent.futures import ThreadPoolExecutor

就一直报上面的错误,后来发现是run.py 执行完就退出了,所以线程池关闭了,在run.py里,加上这个,每个线程都join,就好了

for thread in threads:

    thread.join()

本文标签: futuresscheduleShutdowninterpreter