PipMaster Package Manager Utility
pipmaster is a versatile Python package manager utility designed to simplify common tasks such as package installation, updates, checks, and environment management. The current version is 1.1.8, and it maintains an active release cadence as needed for feature enhancements and bug fixes.
Common errors
-
ModuleNotFoundError: No module named 'pipmaster.pipmaster'
cause Incorrect import path for the `PipMaster` class.fixChange `from pipmaster import PipMaster` to `from pipmaster.pipmaster import PipMaster`. -
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.x/dist-packages/...' (or similar permission errors on Windows)
cause Attempting to install or uninstall packages in a system-wide Python installation without sufficient administrative privileges.fixUse a virtual environment (recommended) or run your script/terminal with administrative privileges (e.g., `sudo python your_script.py` or `sudo pip install ...`). -
ERROR: Cannot uninstall 'package_name'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to a partial uninstall.
cause Attempting to uninstall a package installed via `python setup.py install` or as part of the operating system's package manager, which pip cannot fully manage.fixFor packages installed by your OS package manager (apt, yum, brew), use that manager to uninstall. For distutils-installed projects, manual removal or specific uninstallation scripts from the project might be required.
Warnings
- gotcha When running PipMaster commands that modify system-wide packages (e.g., install, uninstall) outside of a virtual environment, you may encounter permission errors.
- gotcha PipMaster operates on the `pip` installation active in your current Python environment. It does not inherently manage multiple distinct Python environments (e.g., pyenv, conda environments).
- gotcha Uninstalling critical system packages (e.g., `setuptools`, `pip`) using `uninstall_package` can severely break your Python installation.
Install
-
pip install pipmaster
Imports
- PipMaster
from pipmaster import PipMaster
from pipmaster.pipmaster import PipMaster
Quickstart
from pipmaster.pipmaster import PipMaster
pm = PipMaster()
# Example 1: Install a package
pm.install_package("requests")
print(f"'requests' installed: {pm.is_package_installed('requests')}")
# Example 2: Check for updates (will print to console)
pm.check_for_updates()
# Example 3: List installed packages
installed = pm.get_installed_packages()
print(f"Installed packages count: {len(installed)}")
# Example 4: Uninstall a package (use with caution)
# pm.uninstall_package("requests")
# print(f"'requests' installed after uninstall: {pm.is_package_installed('requests')}")