Configure remote Python interpreters
IntelliJ IDEA provides full integration with the Python interpreters running on remote hosts.
Depending on the type of the remote interpreter, follow one of the procedures:
Configure an interpreter using SSH
Make sure that the following prerequisites are met:
An ssh server should run on a remote host, since IntelliJ IDEA runs remote interpreters via ssh-sessions.
If you want to copy your sources to a remote computer, create a deployment configuration, as described in the section Create a remote server configuration.
Navigate to
or press Ctrl+Alt+Shift+S.In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
In the left-hand pane of the Add Python Interpreter dialog, select SSH Interpreter.
Select New server configuration, then specify server information (host, port, and username).
Alternatively, you can select Existing server configuration and choose any available deployment configuration from the list.
If needed, click to review the Connection settings, Mappings, and Excluded paths for the selected deployment configuration. Click Next to continue configuring an interpreter.
In the next dialog window, provide the authentication details to connect to the target server.
Select Password or Key pair (OpenSSH or PuTTY) and enter your password or passphrase. If Key pair (OpenSSH or PuTTY) is selected, specify:
Private key: location of the file with a private key
Passphrase: similar to a password, it serves to encrypt the private key.
Click Next to proceed.
In the next dialog window, verify the path to the desired Python interpreter. You can accept the default, or specify a different one. You have to configure the path mappings between your local project and the server. To do that, click 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.
You can also select the checkbox to enable automatic upload of the local changes to the remote server.
Click Finish.
The configured remote interpreter is added to the list.
Configure an interpreter using Vagrant
Make sure that the following prerequisites are met:
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.
Make sure that the Vagrant plugin is installed and enabled.
Navigate to
or press Ctrl+Alt+Shift+S.In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
In the left-hand pane of the Add Python Interpreter dialog, select Vagrant.
Specify the path to the Vagrant instance folder in Vagrant Instance Folder.
Wait until you see a link in Vagrant Host URL.
In Python interpreter path field, specify the path to the Python executable. You can accept the default, type in a different path, or click to browse.
Click OK.
The configured remote interpreter is added to the list.
Configure an interpreter using WSL
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.Install the Windows Subsystem for Linux and initialize your Linux distribution as described in the WSL Installation Guide.
If your Linux distribution doesn't come with rsync, you need to install it:
sudo apt install rsync
sudo pacman -S rsync
Navigate to
or press Ctrl+Alt+Shift+S.In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
In the left-hand pane of the Add Python Interpreter dialog, select WSL.
Select the Linux distribution with the required Python interpreter.
In Python interpreter path field, specify the path to the Python executable. You can accept the default, type in a different path, or click to browse.
Click OK.
The configured remote interpreter is added to the list.
Configure an interpreter using Docker
Make sure that the following prerequisites are met:
Docker is installed, as described in the Docker documentation.
You have a stable Internet connection.
Ensure that you have a stable Internet connection, so that IntelliJ IDEA can download and run
busybox:latest
. Once you have successfully configured Docker, you can go offline.
Note that you cannot install any Python packages into Docker-based project interpreters.
Navigate to
or press Ctrl+Alt+Shift+S.In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
In the left-hand pane of the Add Python Interpreter dialog, select Docker.
Do one of the following:
Select an existing Docker configuration in the Server dropdown.
Click New to add a Docker configuration and specify how to connect to the Docker daemon.
The connection settings depend on your Docker version and operating system. For more information, see Docker configuration settings.
The Connection successful message should appear at the bottom of the dialog.
For more information about using the Docker integration with IntelliJ IDEA, see Docker.
Specify the image and the path to the Python executable:
Click OK.
The configured remote interpreter is added to the list.
Configure an interpreter using Docker Compose
Make sure that the following prerequisites are met:
Docker is installed, as described in the Docker documentation.
You have a stable Internet connection.
Ensure that you have a stable Internet connection, so that IntelliJ IDEA can download and run
busybox:latest
. Once you have successfully configured Docker, you can go offline.
Note that you cannot install any Python packages into Docker-based project interpreters.
Define necessary services in one or several Docker Compose files.
Navigate to
or press Ctrl+Alt+Shift+S.In the Project Structure dialog, select SDKs under the Platform Settings section, click , and choose Add Python SDK from the popup menu.
In the left-hand pane of the Add Python Interpreter dialog, select Docker Compose.
Do one of the following:
Select an existing Docker configuration in the Server dropdown.
Click New to add a Docker configuration and specify how to connect to the Docker daemon.
The connection settings depend on your Docker version and operating system. For more information, see Docker configuration settings.
The Connection successful message should appear at the bottom of the dialog.
For more information about using the Docker integration with IntelliJ IDEA, see Docker.
In the Add Python Interpreter dialog, specify the docker server and the docker-compose.yml file. Also select the service.
Optionally, specify environment variables.
Finally, specify the path to the Python executable:
Click OK.
The configured remote interpreter is added to the list.
For any of the configured Python interpreters (but Docker-based), you can: