PyCharm 2018.3 Help

Configuring Remote Interpreters via Vagrant

Ensure 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.

  • The required virtual boxes are created.

To configure a remote Python interpreter

  1. Ensure that you have properly initiated and started Vagrant. Basically, you need to open the Terminal window and execute the following commands:

    $ vagrant init ubuntu/trusty64
    and
    $ vagrant up
    See Vagrant documentation for more information.

  2. In the Settings/Preferences dialog (Ctrl+Alt+S)

    , open the Plugins page and install the Vagrant plugin.

  3. In the Project Interpreters page of the Settings/Preferences dialog box, click Settings next to Project Interpreter field.

  4. From the drop-down list, choose Add.

    py add interpreter

  5. In the left-hand pane of the Add Python Interpreter dialog box, click Vagrant:

    py vagrant add interpreter

  6. Click the browse button browseButton next to the field Vagrant instance folder, and specify the desired Vagrant instance folder.

    This results in showing the link to Vagrant host URL.

  7. The Python interpreter path field displays the path to the desired Python executable. You can accept default, or specify a different one.

  8. Click OK. The configured remote interpreter is added to the list.

  9. Back in the Project Interpreter page, if necessary, configure the path mappings:
    1. Click browseButton:

      py edit path mapping

    2. In the dialog box that opens add (icons general add svg) or delete (icons general remove svg) path mappings as desired.

Last modified: 27 February 2019

See Also

Reference:

Language and Framework-Specific Guidelines: