Open principis opened 1 year ago
Got the same issue today when trying to re-install as well.
Any news on this ?
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\SSC\scoop\apps\python\current\Scripts\thefuck.exe\__main__.py", line 4, in <module>
File "C:\Users\SSC\scoop\apps\python\current\Lib\site-packages\thefuck\entrypoints\main.py", line 8, in <module>
from .. import logs # noqa: E402
^^^^^^^^^^^^^^^^^^^
File "C:\Users\SSC\scoop\apps\python\current\Lib\site-packages\thefuck\logs.py", line 8, in <module>
from .conf import settings
File "C:\Users\SSC\scoop\apps\python\current\Lib\site-packages\thefuck\conf.py", line 1, in <module>
from imp import load_source
ModuleNotFoundError: No module named 'imp'
I need to fix my mistakes myself. That shouldnt happen 😆
Okay the master apparently works. Maybe a new version should be released at some time..
lets pray 🙏
installing from sources (following the contributing guide) results in a working installation
It seems the solution might be as follows:
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
And here's a pull request to fix this issue: https://github.com/nvbn/thefuck/pull/1415
Well, at least the unit tests all pass with this branch, I couldn't figure out how to have the functional tests passing though :shrug:
@SimonSchwendele
Okay the master apparently works. Maybe a new version should be released at some time..
fixed with simply sudo apt purge thefuck && pip uninstall thefuck && pip install git+https://github.com/nvbn/thefuck
, as suggested above
imp
is deprecated since python 3.4 and now removed in python 3.12. Currently thefuck cannot be run with python 3.12.I'm able to replace imp, but the tests also break and I don't have enough knowledge of the project to solve those. It would be appreciated if this could be fixed before September, so that I can update thefuck without resorting to ugly fixes for the Fedora 39 release.