pool.apply() 的非常基本的多处理示例从不调用函数或终止

Very basic multiprocessing example with pool.apply() never calls function or terminates

我正在尝试设置下面 multiprocessing 的非常基本的示例。但是,执行仅打印 here<_MainProcess(MainProcess, started)>,而 pool.apply() 甚至从未调用函数 cube()。相反,执行只是无限期地保持 运行 而不会终止。

import multiprocessing as mp

def cube(x):
    print('in function')
    return x**3

if __name__ == '__main__':
    pool = mp.Pool(processes=4)
    print('here')
    print(mp.current_process())

    results = [pool.apply(cube, args=(x,)) for x in range(1,7)]
    print('now here')

    pool.close()
    pool.join()
    print(results)

我尝试了其他各种基本示例,包括 pool.map(),但将 运行 保留在同一个问题中。我在 Windows 10 上使用 Python 3.7。由于我没有想法,有人知道这里出了什么问题或者我该如何进一步调试吗?

谢谢!

谢谢,升级到 Python 3.7.3 解决了问题。