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

Python 3.12: Migrate from deprecated imp to importlib #204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

l4rzy
Copy link

@l4rzy l4rzy commented May 20, 2024

This PR migrates from imp to importlib.
The helper function followed https://docs.python.org/3/whatsnew/3.12.html#imp

This should make recon-ng work with Python 3.12

@hacklexander
Copy link

I tried with your settings but now I get the same error but on line 15 import yaml

Traceback (most recent call last):
File "/usr/share/recon-ng/recon-ng", line 8, in
from recon.core import base
File "/usr/share/recon-ng/recon/core/base.py", line 15, in
import yaml
ModuleNotFoundError: No module named 'yaml'

@l4rzy
Copy link
Author

l4rzy commented May 22, 2024

I tried with your settings but now I get the same error but on line 15 import yaml

Traceback (most recent call last):
File "/usr/share/recon-ng/recon-ng", line 8, in
from recon.core import base
File "/usr/share/recon-ng/recon/core/base.py", line 15, in
import yaml
ModuleNotFoundError: No module named 'yaml'

That has nothing to do with my PR. This is to fix the problem with Python 3.12, which doesn't have imp

@l4rzy l4rzy changed the title Migrate from deprecated imp to importlib Python 3.12: Migrate from deprecated imp to importlib May 22, 2024
@pingpongterminator300
Copy link

Its working

~/venv/bin/python3 --version
Python 3.12.3
~/venv/bin/python3 recon-ng

    _/_/_/    _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/
   _/    _/  _/        _/        _/      _/  _/_/    _/            _/_/    _/  _/       
  _/_/_/    _/_/_/    _/        _/      _/  _/  _/  _/  _/_/_/_/  _/  _/  _/  _/  _/_/_/
 _/    _/  _/        _/        _/      _/  _/    _/_/            _/    _/_/  _/      _/ 
_/    _/  _/_/_/_/    _/_/_/    _/_/_/    _/      _/            _/      _/    _/_/_/    


                                          /\
                                         / \\ /\
    Sponsored by...               /\  /\/  \\V  \/\
                                 / \\/ // \\\\\ \\ \/\
                                // // BLACK HILLS \/ \\
                               www.blackhillsinfosec.com

                  ____   ____   ____   ____ _____ _  ____   ____  ____
                 |____] | ___/ |____| |       |   | |____  |____ |
                 |      |   \_ |    | |____   |   |  ____| |____ |____
                                   www.practisec.com

                      [recon-ng v5.1.2, Tim Tomes (@lanmaster53)]                       

[*] No modules enabled/installed.

[recon-ng][default] > 

@l4rzy
Copy link
Author

l4rzy commented Jun 8, 2024

modules load worked

[recon-ng][default] > marketplace install recon/domains-hosts/hackertarget
[*] Module installed: recon/domains-hosts/hackertarget
[*] Reloading modules...
[recon-ng][default] > modules load recon/domains-hosts/hackertarget
[recon-ng][default][hackertarget] > options set SOURCE github.com
SOURCE => github.com
[recon-ng][default][hackertarget] > run

----------
github.com
----------
[*] Country: None
...

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

Successfully merging this pull request may close these issues.

None yet

3 participants