-
Notifications
You must be signed in to change notification settings - Fork 207
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
AttributeError: Can't pickle local object 'prepare_worker.<locals>.closure.<locals>.wrapper' #72
Comments
Hi guys, Running them with python 3.8 and Pipfile: [dev-packages] [packages] [requires] |
I have the same problem here! Using pandarallel on Windows 10 and Jupyter notebook. |
Getting the same issue on MacOS in Python 3.8 Package Version Edit: Tried the same code in Python 3.7.3 which works no problem. |
Getting the same issue: Windows 10 and Spyder |
Having the same issue on Windows 10 with Jupyter Notebook |
I managed to fix this inspired by this Take a look at this issue But something is working very weird:
Since I didn't solve it completely and I don't have any time and effort to work on it, I will not submit any pull request for now. Here is my patch:
|
I'm running into this as well. In case it's of any help, I think the issue may only occur when you are using the "spawn" start method of multiprocessing (i.e. Would be great to see a fix for this implemented. |
Created a parallel_utils helper module that has parallel_map() and pandas_parallel_apply() functions which use multiprocessing / pandarallel on non-macOS but plain non-parallel versions on macOS. This works around bugs in Python and pandarallel: https://bugs.python.org/issue33725#msg343838 nalepae/pandarallel#72
Created a parallel_utils helper module that has parallel_map() and pandas_parallel_apply() functions which use multiprocessing / pandarallel on non-macOS but plain non-parallel versions on macOS. This works around bugs in Python and pandarallel: https://bugs.python.org/issue33725#msg343838 nalepae/pandarallel#72
I can reproduce this on Linux: Python: 3.10.13 import numpy as np
import pandas as pd
import pandarallel
pandarallel.core.CONTEXT = pandarallel.core.multiprocessing.get_context('spawn')
pandarallel.pandarallel.initialize()
df = pd.DataFrame(np.random.rand(240).reshape(80,3),columns=list('abc'))
df['id'] = np.arange(80) % 10
df.groupby('id')[['a']].parallel_apply(lambda x: pd.DataFrame(np.array([x.values.flatten()]*2),columns=list('abcdefgh'))) This bug only appears for me when using the "spawn" start method. Traceback
|
I would like to run parallel on a Jupyter Notebook in AWS Sagemaker. However even in the most basic examples I get the following error message:
This was thrown when running
The text was updated successfully, but these errors were encountered: