attardi / wikiextractor

A tool for extracting plain text from Wikipedia dumps
GNU Affero General Public License v3.0
3.69k stars 959 forks source link

Question ValueError: cannot find context for 'fork' #287

Closed yaoysyao closed 1 year ago

yaoysyao commented 2 years ago

INFO: Loaded 734526 templates in 4151.8s INFO: Starting page extraction from Traceback (most recent call last): File "Anaconda\Scripts\wikiextractor-script.py", line 33, in sys.exit(load_entry_point('wikiextractor==3.0.6', 'console_scripts', 'wikiextractor')()) File "Anaconda\lib\site-packages\wikiextractor-3.0.6-py3.9.egg\wikiextractor\WikiExtractor.py", line 638, in main File "Anaconda\lib\site-packages\wikiextractor-3.0.6-py3.9.egg\wikiextractor\WikiExtractor.py", line 414, in process_dump File "Anaconda\lib\multiprocessing\context.py", line 239, in get_context return super().get_context(method) File "Anaconda\lib\multiprocessing\context.py", line 193, in get_context raise ValueError('cannot find context for %r' % method) from None ValueError: cannot find context for 'fork'

lubaolalala commented 2 years ago

I had the same problem on windows. When I try wikiextractor on Ubuntu, everything runs well. Maybe you can try it on Ubuntu or docker.

DedaDev commented 1 year ago

fuck, i need this on windows

doneforaiur commented 1 year ago

@DedaDev Maybe try WSL?

huanggefan commented 1 year ago

on windows:

edit: wikiextractor\WikiExtractor.py line 417

Process = get_context("fork").Process -> Process = get_context("spawn").Process