◐ Shell
clean mode source ↗

GitHub - pvm-shell/PVM: Python Version Manager - POSIX-compliant shell tool to install, manage, and switch multiple Python versions

PVM Banner

PVM

Python Version Manager
POSIX-compliant shell script to manage multiple active Python versions.

License Shell Status


Intro

pvm allows you to quickly install, switch, and manage multiple Python versions from the command line.

$ pvm install 3.12
Now using Python 3.12.8
$ python -V
Python 3.12.8

$ pvm use 3.11
Now using Python 3.11.11
$ python -V
Python 3.11.11

Simple, fast, and flexible.


Why PVM?

  • Lightweight and POSIX-compliant
  • No dependency on Python itself
  • Works across shells: sh, bash, zsh, dash, ksh
  • Inspired by nvm, but built specifically for Python
  • Per-project version management with .pvmrc
  • Clean and minimal design

About

pvm is a Python version manager designed to be installed per-user and used per-shell.

It focuses on Python versions, executables, pip, virtual environments, and project-based version control via .pvmrc.

Works across Linux, macOS, and Windows using WSL.


Quick Install

curl -o- https://raw.githubusercontent.com/pvm-shell/PVM/main/install.sh | bash

or:

wget -qO- https://raw.githubusercontent.com/pvm-shell/PVM/main/install.sh | bash

Usage

Install Python

pvm install 3.12
pvm install 3.11
pvm install 3.10

Use Python Version

Show Current Version

List Versions

System Python

PVM can detect and use the Python version already installed on your system.

Example output:

System Python: Python 3.12.4
Path: /usr/bin/python3

To switch back to the system Python:


.pvmrc

echo "3.12" > .pvmrc
pvm use

If the version is not installed:


Virtual Environments

pvm venv .venv
. .venv/bin/activate

Specific version:


Manual Install

git clone https://github.com/pvm-shell/PVM.git ~/.pvm
cd ~/.pvm
. ./pvm.sh

Add to your shell config:

export PVM_DIR="$HOME/.pvm"
[ -s "$PVM_DIR/pvm.sh" ] && . "$PVM_DIR/pvm.sh"

Environment Variables

PVM_DIR
PVM_BIN
PVM_INC
PVM_VERSION
PVM_RC_VERSION

Compatibility Notes

The following environment variables may affect Python version switching:

PYTHONHOME
PYTHONPATH
PIP_PREFIX
PIP_TARGET
VIRTUAL_ENV

If needed:


Uninstall

pvm deactivate
rm -rf ~/.pvm

Project Status

Early development.


License

MIT License. See LICENSE.