IntelliJ IDEA 2020.3 Help

Configure 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:

Configure an SSH interpreter

  1. Ensure that the Python plugin is installed and enabled.

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

    Adding a new SDK

  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.

    Adding a new Python SDK

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

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

    existing configurations

    If needed, click the Browse button to review the Connection settings, Mappings, and Excluded paths for the selected deployment configuration. Click Next to continue configuring an interpreter.

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

  7. In the next dialog window, verify the path to the desired Python interpreter. 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 the Browse button 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.

    Setting SSH mappings

    You can also select the lowest checkbox to enable automatic upload of the local changes to the remote server.

Configure Vagrant

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

  2. Ensure that the Python plugin is installed and enabled.

  3. Navigate to File | Project Structure Ctrl+Alt+Shift+S.

    Adding a new SDK

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

    Adding a new Python SDK

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

    Add an interpreter
  6. Click the browse button the Browse button 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.

Configure WSL

  1. Click the Windows button in the lower-left corner of the screen and start typing System Information. To ensure that your system works well with WSL, upgrade your Windows to the latest available version.

  2. Install the Windows Subsystem for Linux and initialize your Linux distribution as described in the WSL Installation Guide.

  3. Ensure that the Python plugin is installed and enabled.

  4. Navigate to File | Project Structure Ctrl+Alt+Shift+S.

    Adding a new SDK

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

    Adding a new Python SDK

  6. In the left-hand pane of the dialog, click WSL.

    Adding a WSL interpreter
  7. Select the Linux distribution and specify the path to the python executable in the selected Linux distribution. Typically, you should be looking for wsl.exe but you can specify any non default WSL distro.

Configure Docker as a remote interpreter

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

  2. Ensure that the Python plugin is installed and enabled.

  3. Navigate to File | Project Structure Ctrl+Alt+Shift+S.

    Adding a new SDK

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

    Adding a new Python SDK

  5. In the dialog 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:

    Choose a docker
  6. Click OK to complete the task.

Configure Docker Compose as a remote interpreter

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

  2. Ensure that the Python plugin is installed and enabled.

  3. Navigate to File | Project Structure Ctrl+Alt+Shift+S.

    Adding a new SDK

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

    Adding a new Python SDK

  5. In the dialog 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:

    Configure remote Python interpreter
  6. Click OK to complete the task.

For any of the configured Python interpreters (but Docker-based), you can:

Last modified: 08 March 2021