I tried running a simple multiprocessing script but it doesn't seem to work
import multiprocessing
import time
start = time.perf_counter()
def run():
print('sleeping for 1 second')
time.sleep(1)
print('done sleeping')
p1 = multiprocessing.Process(target=run)
p2 = multiprocessing.Process(target=run)
p1.start()
p2.start()
p1.join()
p2.join()
finish = time.perf_counter()
print(f'Finished in {round(finish-start, 2)} second(s)')
The error message says
AttributeError: Can't get attribute 'run' on <module '__main__' (built-in)>
(more than that)