No multiprocessing print outputs (Spyder)

(Spyder maintainer here) Multiprocessing doesn't work well on Windows in Spyder's IPython console. However, you can run your code in an external terminal to have the results you want.

To do that, please go to

Run > Configuration per file > Execute in an external system terminal.

Update: Since our 5.2.0 version (released in November 2021), prints generated while running multiprocessing code are captured and displayed in the IPython console for all operating systems.


You can run it through Spyders' IPython console by saving the function as a different .py file and importing it into the script you're running. For example, save:

def f(name):
    info('function f')
    print('hello', name)

In a file called worker.py. Then in your main file, do the following:

from multiprocessing import Process
import os
import worker

def info(title):
    print(title)
    print('module name:', __name__)
    print('parent process:', os.getppid())
    print('process id:', os.getpid())

if __name__ == '__main__':
    info('main line')
    p = Process(target=worker.f, args=('bob',))
    p.start()
    p.join()