Install & Compatibility
Where this runs
tested against v3.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 39.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.7s · import 0.000s · 40MB
35MB installed
● package 35MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pyvim (executable)
✓ Run 'pyvim' directly from the terminal or via subprocess
✗ from pyvim import Editor
Pyvim is primarily a command-line application, not designed for direct library import of its editor functionality. Components are usually accessed via `prompt_toolkit`.
pyVim (case-sensitive)
✓ pip install pyvim (for this library), pip install pyvmomi (for VMware SDK)
✗ from pyVim import connect
Common `ModuleNotFoundError` due to confusion with the unrelated `pyVim` module which is part of the `pyvmomi` (VMware vSphere SDK) library and uses a capital 'V'. 'pyvim' (lowercase 'v') is a distinct project.
This quickstart demonstrates how to programmatically launch the `pyvim` editor using Python's `subprocess` module. It creates a temporary file, opens it in `pyvim`, and then displays the file's content after the editor is closed. Users interact with `pyvim` directly in their terminal.
import subprocess
import os
# Create a dummy file for editing
file_content = "Hello, pyvim!\nThis is a test file.\n"
with open("example.txt", "w") as f:
f.write(file_content)
print("Launching pyvim to edit example.txt. Press ESC, then :wq to save and exit.")
try:
# Launch pyvim as a subprocess
# The input/output will be connected to the current terminal
subprocess.run(["pyvim", "example.txt"])
except FileNotFoundError:
print("Error: 'pyvim' executable not found. Make sure it's installed and in your PATH.")
except Exception as e:
print(f"An error occurred: {e}")
# Optionally, print the content after editing
if os.path.exists("example.txt"):
with open("example.txt", "r") as f:
print("\nContent of example.txt after editing:")
print(f.read())
pyvim --version
Debug
Known issues
gotchaPerformance can significantly degrade when editing large files (thousands of lines) with syntax highlighting enabled due to Python's string handling and Pygments processing.fixFor very large files, consider disabling syntax highlighting or using native Vim/other editors optimized for large file performance.
affects: All versions
gotchaPyvim's buffer implementation uses simple Python strings, which can be inefficient for extremely large files and may not scale as well as optimized text editor data structures.fixBe aware of potential memory and performance limitations when working with exceptionally large documents.
affects: All versions
gotchaThe documentation on GitHub states compatibility up to Python 3.4. While PyPI's `requires_python` is empty (implying broader Python 3 support), explicit modern Python 3 compatibility (e.g., 3.9+) is not clearly documented by the project author.fixTest `pyvim` with your target Python 3 version to ensure full compatibility. The project's underlying `prompt_toolkit` generally supports modern Python versions.
affects: Unclear for Python >3.4
breakingLack of individual cursor support across split windows can lead to unexpected behavior where the cursor in one window affects other splits, including unintended scrolling.fixThis is a known limitation of the `prompt_toolkit` library that `pyvim` is built upon and may not have a direct workaround within `pyvim` itself. Be mindful of this behavior when using split views.
affects: All versions
Upgrade
Version history
3.0.3latest on PyPI · released May 16, 2022
Audit
Dependencies
prompt_toolkitrequiredCore terminal UI framework.
PygmentsrequiredProvides syntax highlighting functionality.
JedioptionalPowers Python autocompletion (optional, for Python development).
PyflakesoptionalEnables Python code checking (optional, for Python development).