Kali Linux 2020.1a下MITMf安装报错:No module named pyinotify求助
Hey there, let's work through this issue—you're dealing with a mix of Python 2 vs Python 3 compatibility problems since MITMf is a Python 2.x-exclusive tool, and Kali 2020.1a defaults to Python 3 as the primary version. Here's how to resolve it step by step:
1. Get Python 2's pip Working First
Your initial issue with python-pip installation failing might be due to outdated package sources. Let's try fixing that first:
- Update your package list and reattempt installing Python 2's pip:
sudo apt update && sudo apt install python-pip - If that still fails, install Python 2's pip using the official bootstrap script:
- Download the pip bootstrap script compatible with Python 2.7
- Run it with Python 2:
python get-pip.py
2. Install MITMf Dependencies with Python 2's Pip
Once Python 2's pip is working, navigate to your cloned MITMf directory and install all required dependencies correctly (this will include pyinotify):
cd MITMf pip install -r requirements.txt
- If you still get the
pyinotifymissing error afterward, install it directly with:pip install pyinotify
3. Run MITMf with Python 2 (Not Python 3)
The syntax error you see when using python3 mitmf.py is expected—MITMf was never updated to support Python 3. You must use Python 2 to run it:
python mitmf.py --help
Why This Works
Kali 2020.1a ships with Python 3 as the default, so running pip might actually call pip3 (Python 3's package manager) unless you explicitly use pip2 or ensure Python 2's pip is in your path. MITMf's codebase relies on Python 2-specific syntax and libraries, so using Python 3 will always throw errors.
内容的提问来源于stack exchange,提问作者Binod Lamichhane

