WikiExtractor / WikiExtractor/wikiextractor

AttributeError: module '__main__' has no attribute '__spec__'

Open
#140 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4k
Forks
1k
Avg merge
1m
Merged PRs (30d)
10

Description

Getting AttributeError: module 'main' has no attribute 'spec' when running against the lastest af (Afrikaans) wikipedia dump using python C:\ProgramData\Anaconda3\Scripts\WikiExtractor.py --processes 1 --templates templates.fil -o Extracted afwiki-20170901-pages-meta-current.xml.bz2

INFO: Preprocessing 'afwiki-20170901-pages-meta-current.xml.bz2' to collect template definitions: this may take some time.
INFO: Saved 4773 templates to 'templates.fil'
INFO: Loaded 4773 templates in 30.4s
INFO: Starting page extraction from afwiki-20170901-pages-meta-current.xml.bz2.
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\WikiExtractor.py", line 4, in
import('pkg_resources').run_script('wikiextractor==2.69', 'WikiExtractor.py')
File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources_init_.py", line 739, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources_init_.py", line 1507, in run_script
exec(script_code, namespace, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\wikiextractor-2.69-py3.6.egg\EGG-INFO\scripts\WikiExtractor.py", line 3238, in
File "C:\ProgramData\Anaconda3\lib\site-packages\wikiextractor-2.69-py3.6.egg\EGG-INFO\scripts\WikiExtractor.py", line 3228, in main
File "C:\ProgramData\Anaconda3\lib\site-packages\wikiextractor-2.69-py3.6.egg\EGG-INFO\scripts\WikiExtractor.py", line 2923, in process_dump
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 33, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 172, in get_preparation_data
main_mod_name = getattr(main_module.spec, "name", None)
AttributeError: module 'main' has no attribute 'spec'

Running on Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Windows multiprocessing path in process_dump, using the reported WikiExtractor.py command and Python 3.6 environment to reproduce the traceback. Check how the spawned process handles main.spec; done means the Afrikaans dump completes with --processes 1 without this AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.