DataSpell 2024.2 Help

Configure an interpreter using SSH

Configuring remote Python interpreters via SSH

  1. Ensure that there is an SSH server running on a remote host, since DataSpell runs remote interpreters via ssh-sessions.

  2. Do one of the following:

    • Press Ctrl+Alt+S to open Settings and go to Project: workspace | Python Interpreter. 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.

  3. Select On SSH.

  4. Select an option to create a new SSH connection, then specify server information (host, port, and username).

    adding an interpreter via SSH

    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 Browse button next to the list of configurations:

      Add new SSH configuration
    • Click new configuration, disable the Visible only for this project checkbox, and fill in the required fields:

      Adding new SSH configuration
    • Once done, the newly created SSH configuration will appear in the list of available configurations. Click Next to proceed:

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

    specifying authentication details

    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.

  6. Wait until DataSpell completes the introspection of the SSH server.

    SSH server introspection
  7. In the next dialog, select a type of Python environment to configure on the SSH server.

    Selecting a Python environment

    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.

Last modified: 11 October 2024