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

error with" global flags not at the start of the expression at position 4" help~~~ #336

Open
JoeyHuhuu opened this issue Aug 29, 2024 · 5 comments

Comments

@JoeyHuhuu
Copy link

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "D:\Python\Lib\site-packages\wikiextractor\WikiExtractor.py", line 66, in
from extract import Extractor, ignoreTag, define_template, acceptedNamespaces
File "D:\Python\Lib\site-packages\wikiextractor\extract.py", line 378, in
ExtLinkBracketedRegex = re.compile(
^^^^^^^^^^^
File "D:\Python\Lib\re_init
.py", line 228, in compile
return compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_init
.py", line 307, in _compile
p = _compiler.compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_compiler.py", line 743, in compile
p = _parser.parse(p, flags)
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 972, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 855, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 855, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 453, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Lib\re_parser.py", line 833, in _parse
raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 4

@VladOnMyOwn
Copy link

Same here

@VladOnMyOwn
Copy link

@JoeyHuhuu, try this: ab8988e
helped me

@JoeyHuhuu
Copy link
Author

@JoeyHuhuu, try this: ab8988e ,请尝试以下操作: ab8988e helped me 帮助了我

thank you~

@dwiddows
Copy link

dwiddows commented Oct 8, 2024

Thanks, worked for me too with python 3.12, after
pip uninstall wikiextractor
followed by
pip install git+https://github.com/attardi/wikiextractor.git@ab8988ebfa9e4557411f3d4c0f4ccda139e18875

Then python -m wikiextractor.WikiExtractor <Wikipedia xml file> worked as before.

Thanks for this fix, it would be good if it could be merged into the pypi release. (Depends on #335 I guess?)

@janarosmonaliev
Copy link

I am getting this error that setuptools aren't available. I am using the script in a conda env with Python v3.11.7

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [end of output]

Any suggestions?

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

No branches or pull requests

4 participants