Integration with Vagrant helps you create reproducible development environments defined by VagrantFile configuration files.
To have the same environment set up on the machines of all the team members you only need to put the VagrantFile under your team version control.
Any team member can set up the required environment by running the vagrant up command with the relevant VagrantFile.
Vagrant support in PyCharm is provided through the Vagrant plugin that comes bundled with PyCharm.
In this section:
- Working with Reproducible Development Environments Using Vagrant
- Creating and Removing Vagrant Boxes
- Initializing Vagrant Boxes
Prerequisites
Before you start working with Vagrant, make sure that Vagrant plugin is enabled.
The plugin is bundled with PyCharm and activated by default.
If not, enable the plugin as described in Enabling and Disabling Plugins.
Besides that, make sure that the following prerequisites are met (outside of PyCharm):
-
Oracle's VirtualBox
is installed on your computer.
-
Vagrant
is installed on your computer, and all the necessary infrastructure is created.
- The parent folders of the following executable files are added to the system PATH variable:
- vagrant.bat or vagrant from your Vagrant installation. This should be done automatically by the installer.
- VBoxManage.exe or VBoxManage from your Oracle's VirtualBox installation.
Vagrant Support
Once the Vagrant plugin is enabled, the following changes are made to the PyCharm UI:
- A Vagrant page is added to the Settings dialog.
- A Vagrant node is added to the menu. The node contains the following commands
that correspond to the standard Vagrant actions:
Vagrant support in PyCharm features:
- capability to create new virtual boxes, and delete the unnecessary ones.
- capability to configure remote interpreters by reading settings from the Vagrant configuration file.
- capability to initialize Vagrant boxes, and execute other Vagrant commands without leaving the IDE.