python-msilib
raw JSON → 0.6.0 verified Fri May 01 auth: no python
A Python library to read and write Microsoft Installer (.msi) files. Current version 0.6.0, supports Python >=3.13 and is under active development on GitHub.
pip install python-msilib Common errors
error ModuleNotFoundError: No module named 'msilib' ↓
cause You have not installed the python-msilib package, or you are using a Python version that does not include the standard library msilib module (which is part of CPython on Windows only).
fix
Run 'pip install python-msilib'. Note that this package provides the module on all platforms, not just Windows.
error ImportError: cannot import name 'Cab' from 'msilib' ↓
cause The 'Cab' class may have been renamed or moved. In older versions, the correct import may differ.
fix
Use 'from msilib import Cab' or check the current API documentation.
error AttributeError: module 'msilib' has no attribute 'Create' ↓
cause The 'Create' function is not available in the standard library msilib; it is a custom addition in python-msilib.
fix
Use 'from msilib import Create' or call 'msilib.Create(...)' after installing the package.
Warnings
breaking Python 3.13+ only: This library requires Python 3.13 or newer. Older Python versions (3.12, 3.11) are not supported. ↓
fix Upgrade to Python 3.13 or later.
gotcha The package name on PyPI is 'python-msilib', but the import module is 'msilib'. This can cause confusion if you try to 'import python-msilib'. ↓
fix Use 'import msilib' in your code.
deprecated Some APIs from the standard library 'msilib' may be deprecated or changed in newer Python versions. This package aims to maintain compatibility but may lag behind. ↓
fix Check the release notes for changes in API behavior.
Imports
- msilib
import msilib
Quickstart
import msilib
# Create a new MSI database
with msilib.Create('example.msi', msilib.DefaultCab, msilib.UUID.Create()) as db:
print('MSI file created successfully')