Skip to content
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

Sigal Build command fails due to AttributeError #462

Closed
thepowerfulwoz opened this issue Apr 4, 2022 · 3 comments · Fixed by #463
Closed

Sigal Build command fails due to AttributeError #462

thepowerfulwoz opened this issue Apr 4, 2022 · 3 comments · Fixed by #463

Comments

@thepowerfulwoz
Copy link

thepowerfulwoz commented Apr 4, 2022

Traceback (most recent call last):
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\Scripts\sigal.exe\__main__.py", line 7, in <module>
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\sigal\__init__.py", line 173, in build
    gal = Gallery(settings, ncpu=ncpu, quiet=quiet)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\sigal\gallery.py", line 692, in __init__
    self.init_pool(ncpu)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\site-packages\sigal\gallery.py", line 800, in init_pool
    self.pool = multiprocessing.Pool(processes=ncpu, initializer=pool_init)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 119, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild,
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 212, in __init__
    self._repopulate_pool()
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
    return self._repopulate_pool_static(self._ctx, self.Process,
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
    w.start()
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\Alex\AppData\Local\Programs\Python\Python310\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'Gallery.init_pool.<locals>.pool_init'


Not even sure what the issue is in order to begin solving it. Windows 10.

@saimn
Copy link
Owner

saimn commented Apr 5, 2022

Hmm I guess the problem is with

sigal/sigal/gallery.py

Lines 796 to 798 in 246aed5

def pool_init():
if self.settings['max_img_pixels']:
PILImage.MAX_IMAGE_PIXELS = self.settings['max_img_pixels']

Could you try with this patch : 5c287be ?

@thepowerfulwoz
Copy link
Author

Yes that fixed the issue instantly, thank you. Thanks for making such a great tool!

@saimn
Copy link
Owner

saimn commented Apr 6, 2022

Great, thanks for the quick feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants