Configure Python interpreters
The list of Python SDKs, available for the various projects, can include interpreters installed locally, as well as the virtual environments. The procedure described below supposes that the necessary Python interpreters are already installed on your computer.
View the list of the available interpreters
In Settings/Preferences | Build, Execution, Deployment | Python Interpreter, click
or expand the list of interpreters, and choose Show All.
Configure the list of interpreters
In Settings/Preferences | Build, Execution, Deployment | Python Interpreter, click
and choose Add.
Choose the interpreter type to add and perform the specific settings:
VirtualenvIn the left-hand pane of the Add Python Interpreter dialog, select Virtualenv Environment. The following actions depend on whether the virtual environment existed before.
If New environment is selected:
Specify the location of the new virtual environment in the text field, or click
and find location in your file system. The directory for the new virtual environment should be empty.
Choose the base interpreter from the list, or click
and find a Python executable in the your file system.
If CLion detects no Python on your machine, it provides two options: to download the latest Python versions from python.org or to specify a path to the Python executable (in case of non-standard installation).
Select the Inherit global site-packages checkbox if you want that 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.Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in CLion.
If Existing environment is selected:
Expand the Interpreter list and select any of the existing interpreters. Alternatively, click
and specify a path to the Python executable in your file system, for example, C:
\Python36 .\python.exe Select the Make available to all projects checkbox if you want to reuse this environment when creating Python interpreters in CLion.
Click OK to complete the task.