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.

Library not working....

See original GitHub issue

Hello everyone!

While trying to run the example cases and I’m receiving the following error:

Code

import pandas as pd
import pandarallel
pandarallel.initialize()

def func(x):
    return math.sin(x.a**2) + math.sin(x.b**2)

if __name__ == '__main__':
    df_size = int(5e6)
    df = pd.DataFrame(dict(a=np.random.randint(1, 8, df_size),
                           b=np.random.rand(df_size)))
    res_parallel = df.parallel_apply(func, axis=1, progress_bar=True)

Error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<timed exec> in <module>

~\.conda\envs\ingestion-env\lib\site-packages\pandarallel\pandarallel.py in closure(data, func, *args, **kwargs)
    434         try:
    435             pool = Pool(
--> 436                 nb_workers, worker_init, (prepare_worker(use_memory_fs)(worker),)
    437             )
    438 

~\.conda\envs\ingestion-env\lib\multiprocessing\context.py in Pool(self, processes, initializer, initargs, maxtasksperchild)
    117         from .pool import Pool
    118         return Pool(processes, initializer, initargs, maxtasksperchild,
--> 119                     context=self.get_context())
    120 
    121     def RawValue(self, typecode_or_type, *args):

~\.conda\envs\ingestion-env\lib\multiprocessing\pool.py in __init__(self, processes, initializer, initargs, maxtasksperchild, context)
    174         self._processes = processes
    175         self._pool = []
--> 176         self._repopulate_pool()
    177 
    178         self._worker_handler = threading.Thread(

~\.conda\envs\ingestion-env\lib\multiprocessing\pool.py in _repopulate_pool(self)
    239             w.name = w.name.replace('Process', 'PoolWorker')
    240             w.daemon = True
--> 241             w.start()
    242             util.debug('added worker')
    243 

~\.conda\envs\ingestion-env\lib\multiprocessing\process.py in start(self)
    110                'daemonic processes are not allowed to have children'
    111         _cleanup()
--> 112         self._popen = self._Popen(self)
    113         self._sentinel = self._popen.sentinel
    114         # Avoid a refcycle if the target function holds an indirect

~\.conda\envs\ingestion-env\lib\multiprocessing\context.py in _Popen(process_obj)
    320         def _Popen(process_obj):
    321             from .popen_spawn_win32 import Popen
--> 322             return Popen(process_obj)
    323 
    324     class SpawnContext(BaseContext):

~\.conda\envs\ingestion-env\lib\multiprocessing\popen_spawn_win32.py in __init__(self, process_obj)
     87             try:
     88                 reduction.dump(prep_data, to_child)
---> 89                 reduction.dump(process_obj, to_child)
     90             finally:
     91                 set_spawning_popen(None)

~\.conda\envs\ingestion-env\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
     58 def dump(obj, file, protocol=None):
     59     '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60     ForkingPickler(file, protocol).dump(obj)
     61 
     62 #

AttributeError: Can't pickle local object 'prepare_worker.<locals>.closure.<locals>.wrapper'

I’m working on a Jupyter Lab notebook with a conda environment: What can I do?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nalepaecommented, Apr 13, 2020

As written in the Requirements part of the README:

On Windows, Pandaral·lel will works only if the Python session (python, ipython, jupyter notebook, jupyter lab, …) is executed from Windows Subsystem for Linux (WSL). On Linux & macOS, nothing special has to be done.

It is still planned to have Pandarallel working natively on Windows though.

0reactions
nalepaecommented, Mar 14, 2022

Fixed on pandarallel v1.6.0.

Be sure to checkout the documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening a Library in Windows Explorer gives error that it is no ...
Open Windows Explorer. On the left-hand pane, find Libraries and select it. If you do not see Libraries listed, click View on the...
Read more >
Windows Libraries not working or opening? Restore default ...
To fix this issue, first go and delete all the custom Libraries that you may have created and added. Also, delete all the...
Read more >
How to Fix When a Built-In Windows Library isn't Working
First, right-click and delete all of the problem libraries. Then just right-click on the Libraries item in the navigation menu on the left-hand ......
Read more >
App Library not working on iPhone? How to fix it! - iGeeksBlog
You might experience a time when your App Library may stop working on iPhone. 1. Restart your iPhone 2. Check for iOS update...
Read more >
Fix: Documents.library-ms is not working - Appuals.com
Once all the corrupted libraries have been deleted, right-click on the Libraries folder and click on Restore default libraries.
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