CLI tool to check Python import dependencies in .py files
Project description
🧪 installcheck
Check which Python modules your project actually needs – line by line.
🚀 What is this?
installcheck is a CLI tool that scans your Python codebase,
parses every import statement, and checks whether those modules are actually available in your environment.
It helps you:
- Identify missing dependencies 🧩
- Clean up broken or unused imports 🧹
- Write better CI/CD checks 🛠
- Know exactly what you need to
pip install📦
📦 Installation
pip install installcheck
Or for development:
git clone https://github.com/seong-hun/installcheck.git
cd installcheck
pip install -e .
⚙️ Usage
installcheck ./your_project # summary mode
installcheck ./your_project --verbose # line-by-line failure details
🧪 Example Output
✅ All Good
✅ All imports succeeded!
❌ Failures Detected (with –verbose)
❌ Import Failures Detected:
src/foo.py:
[12] from torch.nn import Linear
→ ModuleNotFoundError: No module named 'torch'
[30] import non_existent_lib
→ ModuleNotFoundError: No module named 'non_existent_lib'
Total failed imports: 2 in 1 files
📦 Missing modules you might need to install:
pip install torch non_existent_lib
✨ Features
• ✅ Scans all .py files recursively
• ✅ Ignores virtualenvs and hidden/system folders
• ✅ Parses actual import statements via ast
• ✅ Reports:
• Which files fail
• Which import lines fail (with --verbose)
• Which modules are missing (pip install ...)
• ✅ Multiprocessing for speed ⚡
💡 Why?
Because ModuleNotFoundError should never be a surprise in CI. And because import foo might look innocent… until it silently fails 😅
👩💻 Contributing
Pull requests welcome! Feel free to open issues or suggest improvements.
📄 License
MIT © 2025 Seong-hun Kim
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file installcheck-0.1.0.tar.gz.
File metadata
- Download URL: installcheck-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05345f3fc4e41cdb934dfff0fe9c96200ea1caef1c89233a09d3aa09b0dce273
|
|
| MD5 |
8166894cd9b7fdb082649be5ea1b2205
|
|
| BLAKE2b-256 |
4e2e3d893bdb9332e643bbdf1d24852941f8ea1fbe9813c1186175b9006e36f6
|
File details
Details for the file installcheck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: installcheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9ff9e865c75888bf121a334bb7b62b4b99ea9817973d5ba3e4017fa471dfe67
|
|
| MD5 |
8978a663f51b8c237d59503f75dadc84
|
|
| BLAKE2b-256 |
d29842bd880f7b1b4730d3cd9e4bfa1968264761cf376ba243bee817cbd0b546
|