smmap

raw JSON →
5.0.3 verified Tue May 12 auth: no python install: stale quickstart: stale

A pure Python implementation of a sliding window memory map manager, currently at version 5.0.3, released on March 9, 2026. It is actively maintained with regular updates, including support for newer Python versions and improvements in continuous integration workflows.

pip install smmap
error ModuleNotFoundError: No module named 'smmap'
cause The 'smmap' package is not installed in the current Python environment or is not accessible via the PYTHONPATH.
fix
pip install smmap
error ModuleNotFoundError: No module named 'smmap.mman'
cause This error typically occurs when an older version of GitPython or other dependent code tries to import the 'mman' submodule, which was removed in smmap version 5.0.0.
fix
pip install --upgrade GitPython smmap
error ImportError: cannot import name 'SlidingWindowMapManager' from 'smmap'
cause The 'smmap' package is installed, but the 'SlidingWindowMapManager' class is either not present in the installed version's top-level 'smmap' module, or the installation is corrupted.
fix
pip install --upgrade smmap
breaking Version 6.0.0 dropped support for Python 3.6 and 3.7, and declared support for Python 3.11 and 3.12.
fix Upgrade to Python 3.11 or later.
deprecated Version 5.0.0 dropped support for Python 3.5.
fix Upgrade to Python 3.6 or later.
gotcha Ensure that the smmap package is installed in the correct Python environment to avoid ImportError.
fix Use pip to install smmap in the active environment.
breaking The 'MemoryMap' class was removed from the top-level 'smmap' module in version 5.0.0. For smmap versions 5.x, it was moved to 'smmap.mman'. In version 6.0.0 and later, 'MemoryMap' was entirely removed.
fix If using smmap 5.x, update imports from `from smmap import MemoryMap` to `from smmap.mman import MemoryMap`. If using smmap 6.0.0 or later, 'MemoryMap' is no longer available, and an alternative implementation or library version is required.
breaking The 'MemoryMap' class/symbol was removed from the 'smmap' library in version 0.3.0. Applications attempting to import 'MemoryMap' directly from 'smmap' will fail.
fix Downgrade smmap to a version older than 0.3.0 (e.g., `pip install smmap<0.3.0`) or update your application code to remove the dependency on 'smmap.MemoryMap'.
python os / libc status wheel install import disk
3.10 alpine (musl) - - - -
3.10 slim (glibc) - - - -
3.11 alpine (musl) - - - -
3.11 slim (glibc) - - - -
3.12 alpine (musl) - - - -
3.12 slim (glibc) - - - -
3.13 alpine (musl) - - - -
3.13 slim (glibc) - - - -
3.9 alpine (musl) - - - -
3.9 slim (glibc) - - - -

A basic example demonstrating how to use smmap to memory-map a file and read data from it.

import os
from smmap import MemoryMap

# Initialize a MemoryMap instance
mm = MemoryMap('example.txt')

# Read data from the memory-mapped file
with mm as m:
    data = m.read(1024)
    print(data)