Registry / serialization / pypiwin32

pypiwin32

JSON →
library223pypypiunverified

pypiwin32 is a legacy shim package that facilitated installation of the `pywin32` project on older Python versions. The core `pywin32` extensions provide comprehensive access to many Windows APIs from Python, including COM automation, Windows services, and GUI programming. While `pypiwin32` itself is no longer actively developed (last released 2018), it still serves as a dependency for projects that might not have updated their requirements. The underlying `pywin32` project is actively maintained, with frequent releases. The current latest version of the actual `pywin32` project is 311, released on July 14, 2025.

pip install pypiwin32
INSTALL
IMPORT
SIG · PYPIWIN32
P
pypiwin32
serializationpythonv223
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

win32api
import win32api
win32con
import win32con
win32gui
import win32gui
win32com.client
import win32com.client
pywintypes
import pywintypes
from win32 import pywintypes
While `pywintypes` might be found in a `win32` subdirectory in site-packages, the direct import is standard.

This quickstart demonstrates how to use the `win32com.client` module to automate Microsoft Excel, a common use case for pywin32. It shows how to dispatch an Excel application object, make it visible, create a new workbook, and write data to a cell. This requires Microsoft Excel to be installed on the Windows system where the code is run.

import win32com.client import os # This example demonstrates interacting with Microsoft Excel via COM. # Ensure Excel is installed on the system. try: # Attempt to get an existing Excel application excel = win32com.client.GetActiveObject("Excel.Application") except: # If no active Excel instance, create a new one excel = win32com.client.Dispatch("Excel.Application") excel.Visible = True # Create a new workbook or open an existing one workbook = excel.Workbooks.Add() # Creates a new workbook # Access the first sheet sheet = workbook.Sheets(1) sheet.Name = "PyWin32_Example" # Write some data to a cell sheet.Cells(1, 1).Value = "Hello from pywin32!" sheet.Cells(2, 1).Value = f"Current user: {os.environ.get('USERNAME', 'Unknown')}" print("Excel automation complete. Check your Excel window.") # To close Excel cleanly (optional, uncomment if desired) # workbook.Close(SaveChanges=False) # excel.Quit() # del excel # del workbook # del sheet
Debug
Known issues
breaking`pypiwin32` (version 223) is a legacy package and has effectively been superseded by `pywin32`. Installing `pypiwin32` will pull in `pywin32`, but it's recommended to install `pywin32` directly for current versions and active maintenance.
fix
Use `pip install pywin32` instead of `pip install pypiwin32` for all new projects and consider updating existing projects.
affects: pypiwin32 versions <= 223
gotcha`pywin32` is a Windows-specific library and cannot be installed or run on non-Windows operating systems (like Linux or macOS). Attempts to install it elsewhere will fail.
fix
Ensure you are running Python on a Windows operating system.
affects: All versions
gotchaAfter installing `pywin32` (or indirectly `pypiwin32`), a post-installation script (`pywin32_postinstall.py`) might need to be run from an administrator command prompt to correctly register COM objects and DLLs, especially for global Python installations. This script should generally NOT be run inside virtual environments.
fix
Run `python -m pip install pywin32` (or `pypiwin32`), then if issues arise, navigate to your Python `Scripts` directory (e.g., `C:\PythonXX\Scripts`) and run `pywin32_postinstall.py -install` as an administrator. Avoid running this in virtual environments. For virtual environments, ensure `pywin32` DLLs are correctly symlinked or copied.
affects: All versions, especially when encountering `ModuleNotFoundError` for `pywintypes` or COM-related issues.
gotchaOlder versions of `pypiwin32` (like 223) may contain Python 2 syntax (e.g., `print "string"`) in their `setup.py` or other scripts. If pip attempts to build one of these old cached versions in a Python 3 environment, it will result in a `SyntaxError`.
fix
Ensure `pip` is configured to ignore cached versions or explicitly install `pywin32` directly to get a Python 3 compatible version. `pip install --no-cache-dir pywin32` can sometimes help.
affects: pypiwin32 <= 223 when installed with Python 3
gotchaThe `pywin32` project uses a simple incremental version numbering scheme, and any increase in the version number may correspond to a breaking interface change.
fix
It is recommended that projects using `pywin32` pin the dependency to a specific version (e.g., `pywin32==311`) to avoid unexpected breaking changes.
affects: All versions of `pywin32`
Upgrade
Version history
223latest on PyPI · released Feb 26, 2018
Audit
Dependencies
pywin32required`pypiwin32` is a shim that depends on and installs `pywin32`.
Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
2
Resources
pypiwin32 — pip install pypiwin32 · libregistry