0

Hy, I'm working on Jupyter and using python's multiprocessing library; for some reason jupyter is not executing the function i give him, no matter what the function does: If, for example, I make this block of code run:

import multiprocessing as mp

def f():
    print("yes")

p = mp.Process(target=f)
p.start()
p.join()

It doesn't seem to execute. The funny aspect is that if I run the same block on colaboratory or a normal python file it executes it perfectly. Is there anything I'm missing?

Thanks in advance

  • 1
    How exactly do you use Jupyter to run the code? Are you able to get it to run code that *doesn't* use `multiprocessing`? What exactly does "doesn't seem to execute" mean? What *does* happen? – Karl Knechtel Sep 28 '22 at 20:30
  • I'm able to run anything that doesn't involve multiprocessing, from loops, to functions, it even compiles neural networks with no issues; When I say "doesn't seem to execute" I mean that, if we take the example above, it doesn't print anything, I've also tried using it for changing a variable value (I used both the manager and the multiprocessing Variable object for it) and the value doesn't change. "What does happen?" everithing that doesn't include the process, if for example I write another print function before or after the start and join it executes them flawlessly and raises no errors. – p0l_th3_prof Sep 28 '22 at 22:05
  • Ah, and for "How exactly do you use Jupyter to run the code?" I use anaconda3 and execute the jupyer notebook locally – p0l_th3_prof Sep 28 '22 at 22:05

0 Answers0