**********First problem************
The following code doesn't work in a Windows computer (python 3.7, Jupyter notebook)- nothing happens, the kernel keeps being busy until I restart it, and nothing is printed. BUT it does work on a Linux computer (python 3.6.9, Jupyter notebook).
import multiprocessing as mp
def f(x):
print(x)
return x*x
if __name__ == '__main__':
with mp.Pool(mp.cpu_count()) as p:
print(p.map(f, [1, 2, 3]))
****Partial solution and a following question*****
As suggested in the first comment here, saving f(x) in a different py file partially solved it: it now prints [1, 4, 9] but does not perform the print(x) inside f(x). Any suggestions?