How to Fix “ModuleNotFoundError: No module named ‘pdfkit’” in Mr. Holmes (Kali Linux)
- Get link
- X
- Other Apps
How to Fix “ModuleNotFoundError: No module named ‘pdfkit’” in Mr. Holmes (Kali Linux)
Introduction
Mr. Holmes is a popular OSINT (Open-Source Intelligence) tool used in ethical hacking and cybersecurity learning.
However, many beginners face an error while running the tool on Kali Linux:
ModuleNotFoundError: No module named 'pdfkit'
This error can be confusing, especially for new users.
In this article, you will learn why this error occurs and how to fix it step by step in a clean and safe way.
Error Description
When trying to run Mr. Holmes using the command:
sudo python3 MrHolmes.py
You may see the following traceback ending with:
ModuleNotFoundError: No module named 'pdfkit'
Some users also try to activate a virtual environment and get:
source .lib_venv/bin/activate
source: no such file or directory
Why This Error Happens
This issue usually occurs due to one or more of the following reasons:
1. Virtual Environment Was Not Created
You attempted to activate a virtual environment that does not exist.
2. Python Dependencies Were Not Installed
The pdfkit module and other required packages were not installed from requirements.txt.
3. Missing System Dependency
The pdfkit library requires an external system package called wkhtmltopdf, which is not installed by default.
Step-by-Step Solution (Recommended Method)
Follow these steps in the same order to avoid further errors.
Step 1: Go to the Mr. Holmes Directory
cd ~/Downloads/Mr.Holmes
Step 2: Create a Virtual Environment
python3 -m venv venv
This creates an isolated Python environment for the tool.
Step 3: Activate the Virtual Environment
source venv/bin/activate
Once activated, your terminal will look like this:
(venv) user@kali:~/Downloads/Mr.Holmes$
Step 4: Install Required Python Packages
pip install -r requirements.txt
This command installs all necessary Python modules, including pdfkit.
Step 5: Install the Required System Package
sudo apt install wkhtmltopdf
This step is mandatory because pdfkit depends on it.
Step 6: Run Mr. Holmes (Without sudo)
python3 MrHolmes.py
If everything is installed correctly, the tool should start without errors.
Common Mistakes to Avoid
❌ Running the tool with sudo
❌ Skipping the virtual environment
❌ Ignoring requirements.txt
❌ Forgetting to install wkhtmltopdf
✔ Always run Python tools as a normal user
✔ Use virtual environments for stability
Best Practice Tip
Using a virtual environment prevents:
Dependency conflicts
System Python breakage
Permission-related errors
This is considered a best practice in both cybersecurity and software development.
Conclusion
The error:
ModuleNotFoundError: No module named 'pdfkit'
is not a bug in Mr. Holmes itself.
It simply means the required dependencies are missing.
By:
Creating a virtual environment
Installing Python requirements
Installing
wkhtmltopdf
you can easily fix the issue and run Mr. Holmes smoothly on Kali Linux.
Legal Disclaimer
Mr. Holmes should only be used for educational and ethical purposes.
Always ensure you have proper authorization before performing any reconnaissance or data collection activities.
Author
RedMark
Ethical Hacking | OSINT | Kali Linux
- Get link
- X
- Other Apps

Comments
Post a Comment