Configure an interpreter using SSH
Configuring remote Python interpreters via SSH
Ensure that there is an SSH server running on a remote host, since DataSpell runs remote interpreters via ssh-sessions.
Do one of the following:
Press Ctrl+Alt+S to open Settings and go to . Click the Add Interpreter link next to the list of the available interpreters.
Click the Python Interpreter selector and choose Interpreter Settings. Click the Add Interpreter link next to the list of the available interpreters.
In the context menu of an attached directory, select Interpreter.
Select On SSH.
Select an option to create a new SSH connection, then specify server information (host, port, and username).
Alternatively, you can select Existing and choose any available SSH configuration from the list. To create a new SSH configuration, follow the steps below:
- Creating an SSH configuration
Click next to the list of configurations:
Click, disable the Visible only for this project checkbox, and fill in the required fields:
Once done, the newly created SSH configuration will appear in the list of available configurations. Click Next to proceed:
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.
Wait until DataSpell completes the introspection of the SSH server.
In the next dialog, select a type of Python environment to configure on the SSH server.
You can create a new virtual environment or сonda environment, select an existing one, or use a system interpreter.
Select the Inherit global site-packages checkbox if you want all packages installed in the global Python on your machine to be added to the virtual environment you're going to create. This checkbox corresponds to the
--system-site-packages
option of the virtualenv tool.If you need to execute your Python code on the SSH server as a sudo user, enable the Execute code with root privileges via sudo checkbox.
DataSpell can automatically synchronize files with the remote host. To do that, select the Automatically upload files to remote host checkbox, and specify the root directory for synchronization in Root directory. If the directory doesn't exist, it will be created.
When this option is enabled, the attached directories that have been configured to use the SSH interpreter are uploaded to the root directory on the remote host. Then they are synced upon any of the following events:
Applying changes to files
Switching to this interpreter
IDE start-up
You can exclude files that do need to be synchronized. To do that, specify the glob patterns in the Excluded paths field. By default, the field contains some patterns for directories and files that are not required for running a remote interpreter.
Click Create to complete adding the interpreter.