-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiprocessing failing when function contains a class on the same file #16696
Comments
Hi @andreamoro-git, Thanks for opening this issue, I could reproduce the problem with the snippet you provided. @jitseniesen, @ccordoba12 do you know why this is happening? |
fwiw, I have always directed people towards using "run in external console" when using multiprocessing due to a number of issues. Chiefly among them is that stdout is not always correctly handled (no child print statements in ipython console). The way to debug things like this is then to start spyder like so: Doing this shows that the code is being run in the child, so __main__ is clearly importable in the child, and confirms what the error message suggests (go figure....) that the error occurs when un-pickling the
|
So, @andreamoro-git and @athompson673, if you try to run the snippet of code in an ipython console, the error appears? |
I think @athompson673 meant "Execute in an external system terminal". |
I don't know why this is not working, but
|
The file is saved |
So I checked this issue. I can reproduce with iPython. If you:
This might be a python error?
|
The problem here is that spyder-kernels imports |
Thanks @impact27 for your help with this! This will be fixed in our next version (5.2.2), to be released next week. |
Problem Description
The following code executes properly from the command line but not within spyder. The program hangs and the command window show the traceback pasted below. Placing the class code (everything before
if __name__ == "__main__")
in a separate file and importing the class solves the problem - but it is not clear why this code does not work as it does when executing from the command line.What steps reproduce the problem?
Output
The code hangs with the following traceback
Expected output
A printout of digits from 0 to 9
Versions
The text was updated successfully, but these errors were encountered: