python-vagrant provides Python bindings for interacting with Vagrant virtual machines, allowing programmatic control over Vagrant environments. The current stable version is 1.0.0. Releases are somewhat irregular but active, with bug fixes and minor features released as needed, typically every few months.
pip install python-vagrantVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `python-vagrant`, bring up a VM, check its status, and destroy it. It requires the Vagrant CLI tool to be installed and available in your system's PATH. A simple Vagrantfile is created for demonstration purposes if not already present.
Update calls to `up()` to explicitly pass `vm_name` as the first argument, or `None` if no specific VM name is desired, before other keyword arguments like `provision`.
Upgrade your Python environment to Python 3.8 or newer.
Install Vagrant CLI from HashiCorp's official website (vagrantup.com) or your system's package manager before using `python-vagrant`.
Plan to upgrade your Python environment to Python 3.9 or newer to ensure continued compatibility with `python-vagrant`.
Ensure you are using the public API (e.g., `from vagrant import Vagrant`) and avoid relying on internal module paths.
pip install python-vagrant
Install the Vagrant CLI tool from its official website and ensure its installation directory is added to your system's PATH.
Initialize the `Vagrant` object with the correct path to a directory containing a `Vagrantfile`, or create a `Vagrantfile` in the current working directory.
Ensure the Vagrant VM is running by calling `v.up()` before attempting operations that require a running VM, or check its status with `v.status()`.
No dependency data recorded yet.