-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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.13.1: No module named 'imp' #1489
Comments
I'm facing the same issue with the same Python version. |
Same here, python 3.12.8 |
Since Python 3.12 has removed the import importlib.util
import importlib.machinery
def load_source(modname, filename):
loader = importlib.machinery.SourceFileLoader(modname, filename)
spec = importlib.util.spec_from_file_location(modname, filename, loader=loader)
module = importlib.util.module_from_spec(spec)
# The module is always executed and not cached in sys.modules.
# Uncomment the following line to cache the module.
# sys.modules[module.__name__] = module
loader.exec_module(module)
return module |
Thanks a lot @wandleshen surely helps me a lot! |
i'm using python 3.13.1, and i have encountered a compatibility issue, i think.
when I run 'thefuck', it reports an error:
The text was updated successfully, but these errors were encountered: