marker icon indicating copy to clipboard operation
marker copied to clipboard

[BUG: Breaking]concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

Open MNicholasPro opened this issue 5 months ago โ€ข 2 comments

๐Ÿงจ Describe the Bug

concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

๐Ÿ“„ Input Document

๐Ÿ“ค Output Trace / Stack Trace

Paste the complete stack trace or error output, if available.

Click to expand
 File "D:\Installed\pyenv-win\pyenv-win\versions\3.12.7\Lib\multiprocessing\spawn.py", line 140, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

        To fix this issue, refer to the "Safe importing of main module"
        section in https://docs.python.org/3/library/multiprocessing.html

โš™๏ธ Environment

Please fill in all relevant details:

  • Marker version: 1.8.2
  • Surya version:
  • Python version: 3.12.7
  • PyTorch version: 2.7.1+cu128
  • Transformers version: 4.53.3
  • Operating System (incl. container info if relevant): Win 11

โœ… Expected Behavior

change pdf to markdown

๐Ÿ“Ÿ Command or Code Used

Paste the exact bash command or Python code you used to run Marker:

Click to expand

๐Ÿ“Ž Additional Context

Any other context that might help us debug this (e.g., CLI options, working directory, runtime settings).

MNicholasPro avatar Jul 26 '25 11:07 MNicholasPro

I am facing this error too while running it in my IDE but when I run it in a python shell it works fine.

alirashidAR avatar Jul 30 '25 10:07 alirashidAR

can you paste your code snippet? sometimes this error happens because of not wrapping

if __name__ == '__main__':
    ...

zanussbaum avatar Jul 31 '25 14:07 zanussbaum