Skip to content
/ pkgman Public

The easiest way of auto-installing and importing many libraries in Python scripts.

License

Notifications You must be signed in to change notification settings

reycn/pkgman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文 img

Package Man

The easiest way of auto installing and importing many libraries in Python. Inspired by pacman in R

Features

  • 🤖 Auto-detection if a pip library is not installed
  • 🚀 A faster way than manual detection and installation
  • 👶 Ease-of-use at the baby level

Recent updates

  • 2025-07-28 Add support for variadic arguments
  • 2024-11-27 Initialized, supporting installing a single package and a list of packages

Installation

pip install pkgman

Usage

Install and import a bunch of libraries using two lines:

  • A single module

    from pkgman import include
    include("numpy")
  • Many modules

    from pkgman import include
    include(["numpy", "pandas"])

    Or simply use variadic arguments without the parentheses ([list]) of the list

    from pkgman import include
    include("numpy", "pandas")

Then, all of them will be imported; and if not installed, installed and imported.

Example 1. Import multiple modules that may not be installed

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:

Empty DataFrame
Columns: []
Index: [] 5.4

Yes!

Example 2. Import a single modeul

You can also use it for only one module:

from pkgman import include
include("numpy")

License

MIT License

About

The easiest way of auto-installing and importing many libraries in Python scripts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages