shmilylty / OneForAll

OneForAll是一款功能强大的子域收集工具
GNU General Public License v3.0
7.96k stars 1.27k forks source link

ImportError: cannot import name 'sre_parse' from 're' #295

Closed clcc2019 closed 1 year ago

clcc2019 commented 1 year ago

Whether the latest code is used Yes Bug description

Traceback (most recent call last):
  File "/root/workdir/domain/OneForAll/oneforall.py", line 16, in <module>
    from brute import Brute
  File "/root/workdir/domain/OneForAll/brute.py", line 14, in <module>
    import exrex
  File "/usr/local/lib/python3.11/dist-packages/exrex.py", line 25, in <module>
    from re import sre_parse, U
ImportError: cannot import name 'sre_parse' from 're' (/usr/lib/python3.11/re/__init__.py)

Operation environment

How to reproduce

  1. Step (optional) install and run python3 oneforall.py --help

  2. Command (required) python3 oneforall.py --help

Error text Copy the complete error text (required)

Expected results A clear and concise description of the expected results (optional, such as what a normal situation should look like)

Actual results A clear and concise description of the actual results (optional, such as any errors)

Screenshot Screenshot of complete OneForAll execution process (recommended upload)

Log upload Upload oneforall.log files (it is recommended to upload logs in case of complex problems)

Supplementary information Some other supplementary notes about bug

clcc2019 commented 1 year ago

edit /usr/local/lib/python3.11/dist-packages/exrex.py


#from re import sre_parse, U
import sre_parse
1trapbox commented 1 year ago

The same problem, this problem should be that python is not installed using the binary installation package. For example, I use scoop to install python.

ghost commented 1 year ago

Getting the same error while on mac, tried doing what clcc2019 said but cant find the file to do it in.

Harish-GK commented 1 year ago

Getting the same error while on mac, tried doing what clcc2019 said but cant find the file to do it in.

you check your python version such as python3 -V then you will get a version number now replace the python3.1.1 in below command as your version whichever it is,... run below command

nano /usr/local/lib/python3.11/dist-packages/exrex.py

then comment the line like this

from re import sre_parse, U

add the line import sre_parse ctrl+x enter

now go to the OneForAll folder check if the tool works.. python3 oneforall.py --help q