PyCharm Edu 2019.2 Help

Configuring Python Interpreter

In PyCharm Edu you are not limited to using just any single Python interpreter. You are able to implement several and in doing so choose which interpreter you wish to use for any specific project.

PyCharm Edu supports:

Python interpreters can be configured on the following levels:

  • Current project: selected Python interpreter will be used for the current project.

    Configuring Python interpreter on this level is described below.

  • New project: selected Python interpreter will be used for the new project instead of the default one.

Creating a new project interpreter

To add a new interpreter to the current project:

  1. Open the Add Python Interpreter dialog by either way:

    • When you're in the Editor, the most convenient way is to use the Python Interpreter widget in the status bar. Click the widget and select Add Interpreter ...

    • Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or PyCharm Edu | Preferences for macOS.

      In the Settings/Preferences dialog Ctrl+Alt+S, select Project <project name> | Project Interpreter. Click the The Configure project interpreter icon and select Add.

  2. Choose the interpreter type to add and perform the specific settings:

    In the left-hand pane of the Add Python Interpreter dialog, select Virtualenv Environment. The following actions depend on whether the virtual environment existed before.

    creating a virtual environment

    If New environment is selected:

    1. Specify the location of the new virtual environment in the text field, or click Virtual environment location and find location in your file system. Note that the directory where the new virtual environment should be located, must be empty!

    2. Choose the base interpreter from the list, or click Choose the base interpreter and find a Python executable in the your file system.

    3. Select the Inherit global site-packages checkbox if you want to inherit your global site-packages directory. This checkbox corresponds to the --system-site-packages option of the virtualenv tool.

    4. Select the Make available to all projects checkbox, if needed.

    If Existing environment is selected:

    1. Expand the Interpreter list and select any of the existing interpreters. Alternatively, click Select an interpreter and specify a path to the Python executable in your file system, for example, C:\Python36\python.exe.

    2. Select the checkbox Make available to all projects, if needed.

    Click OK to complete the task.

    See Configuring Virtualenv Environment for more details.

    If you have added the user base’s binary directory to your PATH environmental variable, you don't need to set any additional options: the path to the pipenv executable will be autodetected.

    Click OK to complete the task.

    If you have not modified the PATH variable, PyCharm Edu shows an error message: Pipenv executable is not found. Discover the proper executable path as described in the pipenv installation procedure and enter the target string in the Pipenv executable field, for example: C:\Users\jetbrains\AppData\Roaming\Python\Python37\Scripts\pipenv.exe (Windows) or /Users/jetbrains/.local/bin/pipenv (macOS).

    Click OK to save the changes and complete the task.

    See Configuring Pipenv Environment for more details.

    In the left-hand pane of the Add Python Interpreter dialog, select Conda Environment. The following actions depend on whether the Conda environment existed before.

    If New environment is selected:

    1. Specify the location of the new Conda environment in the text field, or click Conda environment location and find location in your file system. Note that the directory where the new Conda environment should be located, must be empty!

    2. Select the Python version from the list.

    3. Specify the location of the Conda executable file in the text field, or click Conda executable location and find location in the Conda installation directory.

    4. Select the Make available to all projects checkbox, if needed.

    If Existing environment is selected:

    1. Expand the Interpreter list and select any of the existing interpreters. Alternatively, click Select an interpreter and specify a path to the Conda executable in your file system, for example, C:\Users\jetbrains\Anaconda3\python.exe.

    2. Select the checkbox Make available to all projects, if needed.

    Click OK to complete the task.

    See Configuring Conda Environment for more details.

    In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter.

    Adding a system interpreter

    In the Interpreter field, type the fully-qualified path to the required interpreter executable, or click the Browse button and in thelib Select Python Interpreter dialog that opens, choose the desired Python executable and click OK.

    You will need admin privileges to install, remove, and upgrade packages for the system interpreter. When attempting to install an interpreter package through an intention action, you might receive the following error message:

    System Interpreter warning message
    As prompted, consider using a virtual environment for your project.

    Click OK to complete the task.

    See Configuring System Interpreter for more details.

Viewing the list of available interpreters

The list of Python interpreters, available for the various projects and the various virtual environments.

To view the list of available interpreters

Setting an existing project interpreter

At any time, you can switch your project interpreter either using the Python Interpreter widget or in the project Settings/Preferences.

Changing the project interpreter using the Python Interpreter widget

The Python Interpreter widget is located on the status bar. It is the most convenient and quickest way to switch the project interpreter. Just click it and select the target interpreter:

Project interpreter widget

Changing the project interpreter in the project settings

  1. Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or PyCharm Edu | Preferences for macOS.

    Select Project <project name> | Project Interpreter.

  2. Expand the list of the available interpreters and click the Show All link. Alternatively, click the The Configure project interpreter icon and select Show All.

  3. Select the target interpreter.

    View interpreters

    When PyCharm Edu stops supporting any of the outdated Python versions, the corresponding project interpreter is marked as unsupported.

  4. Optionally, you can click Edit and type an alternative interpreter name.

    Changing interpreter's name
    The Python interpreter name specified in the Name field, becomes visible in the list of available interpreters. Click OK to apply the changes.

Working on the same project on different platforms

You can work on the same PyCharm Edu project on different platforms (for example, on Windows at work, and on MacOS at home). This can be easily done, if you rename the project interpreter.

The reason is that PyCharm Edu stores the interpreter name with the project, but not the interpreter path.

To rename an interpreter, follow these steps

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click the page Project Interpreter, and select the desired project.

  2. Do one of the following:

    • Click Project interpreter next to the Project Interpreter field, and in the list of interpreter types, choose Show All....

    • Click the list in the Project Interpreter field, and choose Show All....

      Show all interpreters

    The dialog Project Interpreters opens.

  3. Choose the desired interpreter and click Edit. The dialog Edit Python Interpreter appears.

  4. In this dialog, change the interpreter name as required.

    Renaming interpreter

Last modified: 22 January 2020