PyCharm 2018.2 Help

Configuring Python Interpreter

Introduction

In PyCharm 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 supports:

When a remote Python interpreter is added, at first the PyCharm helpers are copied to the remote host. PyCharm helpers are needed to run remotely the packaging tasks, debugger, tests and other PyCharm features. Next, the skeletons for binary libraries are generated and copied locally. Also all the Python library sources are collected from the Python paths on a remote host and copied locally along with the generated skeletons. Storing skeletons and all Python library sources locally is required for resolve and completion to work correctly. PyCharm checks remote helpers version on every remote run, so if you update your PyCharm version, the new helpers will be uploaded automatically and you don't need to recreate remote interpreter. SFTP support is required for copying helpers to the server.

Python interpreters can be configured on the following levels:

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

Viewing the list of available interpreters

The list of Python interpreters, available for the various projects, can include interpreters installed locally or remotely, and the various virtual environments.

To view the list of available interpreters

Changing Name of a Python Interpreter or Virtual Environment

With PyCharm, one can easily discern numerous Python interpreters and virtual environments by their names, rather than by the long paths to the executables.

To change visible name of a Python interpreter

  1. In the Project Interpreters page, select one of the configured interpreters or virtual environments.
  2. Click icons actions edit svg.
  3. In the Edit Python Interpreter dialog box that opens, type the desired interpreter name.
    py change interpreter name

    The Python interpreter name specified in the Name field, becomes visible in the list of available interpreters.

    If necessary, change the path to the Python executable.

Working on the same project on different platforms

You can work on the same PyCharm 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 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 gear icon next to the Project Interpreter field, and in the list of interpreter types, choose Show All....
    • Click the drop-down list in the Project Interpreter field, and choose Show All....
      py show all

    The dialog box Project Interpreters opens.

  3. Choose the desired interpreter and click icons actions edit svg. The dialog box Edit Python Interpreter appears.
  4. In this dialog, change the interpreter name as required.
    py interpreter rename
Last modified: 17 August 2018

See Also

Concepts: