- r/Python: Show r/Python: I built
pymanager— run libraries that require older Python versions in your modern environment under the hood with zero config - Hacker News: Show HN: pymanager – Transparent multi-version Python execution for virtualenvs
- Python Discourse: Idea/Project: Transparent multi-version execution for legacy dependencies in standard virtualenvs
Hey everyone,
Whenever a new Python version comes out (like 3.13 or 3.14), we all want to upgrade to take advantage of speedups and new features. But inevitably, a legacy dependency (or a transitive requirement) has Requires-Python: <3.12, >=3.8 and hasn't released compatible wheels.
You're usually left with two choices:
- Stay stuck on the older Python version across your entire stack.
- Spend days rewriting or replacing the library.
I wanted to fix this at the environment level, so I built pymanager.
Instead of making developers learn a new tool, CLI, or configuration file, it works directly under the hood of standard Python virtual environments:
import requests # Runs natively on modern Python (e.g. 3.12+)
import click # Runs natively on modern Python (e.g. 3.12+)
import scipy.constants # Incompatible with 3.12+? Runs in Python 3.11 under the hood!
# Standard code - zero changes needed
c = scipy.constants.value("speed of light in vacuum")
print(f"Speed of light: {c} m/s")- Dynamic Version Discovery: When an import cannot be satisfied by the host interpreter, it inspects PyPI metadata to see what Python versions the library supports, then queries available Python releases to find the highest compatible version (e.g., Python 3.11.17 for
<3.12, >=3.8). Zero hardcoded version lists. - Self-Contained Portable Builds: It pulls a standalone portable Python build directly into
.venv/.compat/— no system compilers or host SDKs required. - Transparent Proxying: An import hook (
sys.meta_path) intercepts the import and returns a proxy module that forwards attributes and function calls over an isolated subprocess IPC bridge. - Instant re-runs: The sub-environment is cached within
.venv, so subsequent imports run in milliseconds.
git clone https://github.com/<your-username>/pymanager.git
cd pymanager
./run_demo.shIt includes a 50-test unit and integration test suite (pytest tests/).
I'd love to hear your feedback:
- How do you currently handle legacy dependencies that block your Python upgrades?
- What edge cases would you like to see handled (complex C-extension object passing, IPC serialization strategies)?
GitHub Repo: [link]