shmilylty / OneForAll

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

Python 3.11版本无法使用 因为缺少sre_parse库 #291

Closed yz1639 closed 1 year ago

yz1639 commented 1 year ago

是否使用了最新代码

Bug描述

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

运行环境

如何复现 直接用python311运行即可

复现命令 python .\oneforall.py

报错文本

python311 .\oneforall.py
Traceback (most recent call last):
  File "D:\infiltrate\infomation\子域名爆破\OneForAll-0.4.5\oneforall.py", line 16, in <module>
    from brute import Brute
  File "D:\infiltrate\infomation\子域名爆破\OneForAll-0.4.5\brute.py", line 14, in <module>
    import exrex
  File "D:\Python\Python311\Lib\site-packages\exrex.py", line 25, in <module>
    from re import sre_parse, U
ImportError: cannot import name 'sre_parse' from 're' (D:\Python\Python311\Lib\re\__init__.py)

预期结果

NAME
    oneforall.py - OneForAll help summary page

SYNOPSIS
    oneforall.py - GROUP | COMMAND | VALUE

DESCRIPTION
    OneForAll is a powerful subdomain integration tool

    Example:
        python3 oneforall.py version
        python3 oneforall.py check
        python3 oneforall.py --target example.com run
        python3 oneforall.py --targets ./domains.txt run
        python3 oneforall.py --target example.com --alive False run
        python3 oneforall.py --target example.com --brute False run
        python3 oneforall.py --target example.com --port medium run
        python3 oneforall.py --target example.com --fmt csv run
        python3 oneforall.py --target example.com --dns False run
        python3 oneforall.py --target example.com --req False run
        python3 oneforall.py --target example.com --takeover False run
        python3 oneforall.py --target example.com --show True run

    Note:
        --port   small/medium/large  See details in ./config/setting.py(default small)
        --fmt csv/json (result format)
        --path   Result path (default None, automatically generated)

GROUPS
    GROUP is one of the following:

     data

     datas

     domains

COMMANDS
    COMMAND is one of the following:

     check
       Check if there is a new version and exit

     check_param
       Check parameter

     config_param
       Config parameter

     export_data
       Export data from the database

     main
       OneForAll main process

     run
       OneForAll running entrance

     version
       Print version information and exit

VALUES
    VALUE is one of the following:

     access_internet

     alive

     brute

     dns

     domain

     enable_wildcard

     fmt

     in_china

     path

     port

     req

     takeover

     target

     targets

实际结果

python311 .\oneforall.py
Traceback (most recent call last):
  File "D:\infiltrate\infomation\子域名爆破\OneForAll-0.4.5\oneforall.py", line 16, in <module>
    from brute import Brute
  File "D:\infiltrate\infomation\子域名爆破\OneForAll-0.4.5\brute.py", line 14, in <module>
    import exrex
  File "D:\Python\Python311\Lib\site-packages\exrex.py", line 25, in <module>
    from re import sre_parse, U
ImportError: cannot import name 'sre_parse' from 're' (D:\Python\Python311\Lib\re\__init__.py)

屏幕截图 image

ghost commented 1 year ago

我也是

1trapbox commented 1 year ago

编辑 /../../site-packages/exrex.py


import sre_parse```
FaithZSW commented 1 year ago

我也是,有没有解决方案

JrDw0 commented 1 year ago

项目兼容最新版本python的成本较高,建议各位使用venv或者virtualenv的虚拟python环境来管理并使用多个python版本,或者通过docker使用。