question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with multiprocessing with Thonny 3.3.13 under Windows10

See original GitHub issue

Running this code fails.

import multiprocessing 
def y(x):
    print(x)
if __name__ == '__main__':
    f = multiprocessing.Process(target = y, args=('a'))
    f.start()
    f.join()

Errors:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files (x86)\Thonny\lib\multiprocessing\spawn.py", line 105, in spawn_main
    exitcode = _main(fd)
  File "C:\Program Files (x86)\Thonny\lib\multiprocessing\spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
AttributeError: Can't get attribute 'y' on <module '__main__' (built-in)>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aivarannamaacommented, Mar 23, 2022

I’ll add a warning and suggestion for running via Terminal when Thonny’s backend detects importing multiprocessing.

0reactions
Ivozcommented, Aug 16, 2022

I’ll test later, whether a6bafcc helped here as well

Applying this just in my 3.3.13 thonny worked as well, to get multiprocessing working. Line 133 under Thonny\Lib\site-packages\thonny\plugins\cpython\cpython_backend.py

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError on windows trying python multiprocessing
RuntimeError: Attempt to start a new process before the current process has finished its bootstrapping phase. This probably means that you are  ......
Read more >
Thonny, Python IDE for beginners
Thonny's editor makes these easy to spot. Visualization of syntax errors. Explains scopes. Highlighting variable occurrences reminds you that the same name ...
Read more >
THONNY 3.3.0 failing to install package MULTIPROCESSING
I am actually using a PYTHON IDE called THONNY 3.3.- and I am not geting any success to install the package MULTI{ROCESSING. Error...
Read more >
can't get attribute 'f' on <module '__main__' (built-in)> - You.com
I got multiprocessing to work from within a Jupyter notebook on Windows by saving my function in a separate .py file and including...
Read more >
thonny Changelog - PyUp.io
Fix error when running script with closed Shell, 2412 ... For fallback publish 32-bit bundle with Python 3.8 for 32-bit Windows 10 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found