The easiest way of auto installing and importing many libraries in Python. Inspired by pacman in R
- 🤖 Auto-detection if a pip library is not installed
- 🚀 A faster way than manual detection and installation
- 👶 Ease-of-use at the baby level
2025-07-28Add support for variadic arguments2024-11-27Initialized, supporting installing a single package and a list of packages
pip install pkgman
Install and import a bunch of libraries using two lines:
A single module
frompkgmanimportincludeinclude("numpy")
Many modules
frompkgmanimportincludeinclude(["numpy", "pandas"])
Or simply use variadic arguments without the parentheses (
[list]) of the listfrompkgmanimportincludeinclude("numpy", "pandas")
Then, all of them will be imported; and if not installed, installed and imported.
For example, if we want to import numpy and pandas but the package may not be installed, see multiple.modules.py
And the outputs will be:
[pkgman] Installing and importing ['numpy', 'pandas']...
[pkgman] 2 packages have been imported.Now we check if they are properly imported:
EmptyDataFrameColumns: []
Index: [] 5.4Yes!
You can also use it for only one module:
frompkgmanimportincludeinclude("numpy")MIT License
