Comments (4)
+1 On this error.
Getting the same exact error output on my windows install.
(Although it seems this issue is not System-Specific I'll fill out an issue template aswell.)
- The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Python312\Scripts\thefuck.exe_main.py", line 4, in
File "C:\Python312\Lib\site-packages\thefuck\entrypoints\main.py", line 8, in
from .. import logs # noqa: E402
^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\thefuck\logs.py", line 8, in
from .conf import settings
File "C:\Python312\Lib\site-packages\thefuck\conf.py", line 1, in
from imp import load_source
ModuleNotFoundError: No module named 'imp'
- Your system (Debian 7, ArchLinux, Windows, etc.):
Windows 11, using Powershell
- How to reproduce the bug:
pip install thefuck
fuck
- The error msg:
Same as above
from thefuck.
Fixed this issue, caused my deprecated package "imp" in Python 12
Check 904693a
from thefuck.
Still getting the same issue on thefuck 3.32
and PowerShell 7.4.1
.
Looking at mentioned commit, the page gives a warning
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comparing it to the current main branch, it looks like imp
is still in place (red is main
, green is suggested fix).
from six import text_type
from . import const
from .system import Path
+ 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
- try:
- import importlib.util
-
- def load_source(name, pathname, _file=None):
- module_spec = importlib.util.spec_from_file_location(name, pathname)
- module = importlib.util.module_from_spec(module_spec)
- module_spec.loader.exec_module(module)
- return module
- except ImportError:
- from imp import load_source
@Theblackcat98 did you suggest this change in a PR that you could reference?
Did the fix magically disappear? :)
from thefuck.
related: #1434
from thefuck.
Related Issues (20)
- Unhandled `apt` "Packages were downgraded and -y was used without --allow-downgrades" error
- Support for Windows CMD HOT 4
- /.zshrc:1: command not found: thefuck HOT 3
- Shell slow to start with `eval "$(thefuck --alias)"`, workaround is a lazy loading trick HOT 1
- Fuck command does not work on Alacritty (Mint) HOT 1
- When using Windows Terminal to ssh to a remote server with Zsh/OMZ/powerlevel10k, and instant mode in ~/.zshrc, sometimes crash on start up.
- ModuleNotFoundError: No module named 'imp' when running 'fuck' HOT 20
- Error in building development container
- Feature Request: Instant-Interactive Mode + Zoxide with FZF HOT 1
- Compatibility with pytest 8
- apt command completion error
- Alternative Exit sequence? HOT 1
- Doesn't work in nushell (sees it as generic shell) HOT 1
- [Suggestion]
- ModuleNotFoundError: No module named 'distutils' related to #1434 HOT 5
- "imp" module removed in python 3.12 HOT 1
- Thefuck with Python 3.12.x HOT 3
- Thefuck 3.32 issue on Fedora 40
- Having a hard time getting set up on Ubuntu 24.04 HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thefuck.