Configure an interpreter using WSL
DataSpell doesn't support the Legacy Console mode in WSL environments
You can use Windows Subsystem for Linux (WSL) to work with a Python interpreter available in your Linux distribution.
Ensure that you have downloaded and installed Python on your computer.
- Installing Python on Windows from Microsoft Store
If you are on Windows, you can download Python from the Microsoft Store and install it as a Python interpreter. Once the Python application is downloaded from the Microsoft Store, it becomes available in the list of the Python executables.
Note that interpreters added from the Microsoft Store installations come with some limitations. Because of restrictions on Microsoft Store apps, Python scripts may not have full write access to shared locations such as
TEMP
and the registry.
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:
debianarchsudo apt install rsync
sudo pacman -S rsync
note
When working with WSL 2, mind the following known WSL issues:
Debugger doesn't work properly if firewall is not opened for WSL IP.
Do one of the following:
Press CtrlAlt0S 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.
Select On WSL.
Wait until DataSpell detects Linux on your machine and completes introspection. Click Next to proceed:
In the left-hand pane of the dialog, select the type of the WSL interpreter you want to create: Virtual Environment, Conda Environment, or System Interpreter.
For a system interpreter, just provide the path to the Python executable in the selected Linux distribution.
For virtual and conda environments, you can provide a path to a Python executable of an existing environment in the selected Linux distribution or create a new environment based on the specified Python.
Once done, the new interpreter will be added to your project, and the default mnt mappings will be set.
To run Terminal in WSL configuration, open project Settings/Preference (CtrlAlt0S) and go to Tools | Terminal.
Specify the command in the Shell path field:
wsl.exe
to use the default Linux distributionwsl.exe -d <distribution name>
to use a specific Linux distribution
Click OK to save changes.
Switch to the Terminal tool window and type any command to inspect the output.
tip
To activate a virtual environment in the WSL terminal, run the following commands:
source .venv/bin/activate
.
Thanks for your feedback!