IntelliJ IDEA 2018.2 Help

Configuring Remote Python Interpreters

IntelliJ IDEA provides full integration with the Python interpreters running on remote hosts.

Depending on type of the remote interpreter, follow one of the procedures:

To configure an SSH interpreter:

  1. Navigate to File | Project Structure (Ctrl+Shift+Alt+S).

  2. In the Project Structure dialog, select SDKs under the Platform Settings section, click Add a new SDK, and from the popup menu, choose Python SDK.

  3. In the left-hand pane of the Add Python Interpreter dialog box, click SSH Interpreter.

  4. In the right-hand pane select New server configuration, then specify server information (host, port, and username).

    adding an interpreter via SSH
    Alternatively, you can select Existing server configuration and choose any available deployment configuration from the list.
    py existing ssh configuration
    If needed, click browseButton to review the Connection settings, Mappings, and Excluded paths for the selected deployment configuration. Click Next to continue configuring an interpreter.

  5. In the next dialog window, provide the authentication details to connect to the target server.
    specifying authentication details

    Select Password or Key pair (OpenSSL or PuTTY) and enter your password or passphrase.

    Click Next to proceed with the final configuration step.
  6. In the next dialog window, verify the path to the desired Python interpreted. You can accept default, or specify a different one. You have to configure the path mappings between your local project and the server. To do that, click browseButton next to the Sync folders field and enter the path to the local project folder and the path to the folder on the remote server.

    py interpreter ssh mappings

    You can also select two checkboxes to upload local project directories to the remote server and to enable automatic upload of the local changes to the remote server.

  7. Click Finish to complete adding an interpreter.

To configure Vagrant:

  1. Ensure that a Vagrant instance is created on your machine and properly initialized.

  2. Navigate to File | Project Structure (Ctrl+Shift+Alt+S).

  3. In the Project Structure dialog, select SDKs under the Platform Settings section, click Add a new SDK, and from the popup menu, choose Python SDK.

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

    py vagrant add interpreter

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

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

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

To configure Docker as a remote interpreter:

  1. Ensure that you have set up Docker on your machine.

  2. Navigate to File | Project Structure (Ctrl+Shift+Alt+S).

  3. In the Project Structure dialog, select SDKs under the Platform Settings section, click Add a new SDK, and from the popup menu, choose Python SDK.

  4. In the dialog box that opens, select the Docker option, from the drop-down lists select the Docker server (if the server is missing, click New...), and specify the image name.

    Python interpreter path should have the default value, for example, python:

    py choose docker
  5. Click OK to complete the task.

To configure Docker Compose as a remote interpreter:

  1. Ensure that you have set up and run Docker Compose on your machine.

  2. Navigate to File | Project Structure (Ctrl+Shift+Alt+S).

  3. In the Project Structure dialog, select SDKs under the Platform Settings section, click Add a new SDK, and from the popup menu, choose Python SDK.

  4. In the dialog box that opens, select the Docker Compose option, from the drop-down lists select the Docker server, Docker Compose service (here web), configuration file (here docker-compose.yml)and image name (here python).

    Next, wait while IntelliJ IDEA starts your Docker-Compose configuration to scan and index:

    py docker as remote
  5. Click OK to complete the task.

Last modified: 15 October 2018