Configuring PyCharm settings
In PyCharm, you can configure the settings on two levels: the project level and globally .

Global settings apply to all projects that you open with a specific installation or version of PyCharm. Such settings include IDE appearance (themes, color schemes, menus and toolbars), notification settings, the set of the installed and enabled plugins, debugger settings, code completion, and so on.
Project settings apply to the current project only, unless you configure them as default settings for new projects . Such settings include VCS configuration, code style options, the list of language inspections, and so on.
To configure your IDE, select PyCharm | Settings for macOS or File | Settings for Windows and Linux. Alternatively, press Control+Alt+S or click on the toolbar.
Settings that are NOT marked with the icon in the Settings dialog are global and apply to all existing projects of the current PyCharm version.

Restore IDE settings
When you restore the default IDE settings, PyCharm backs up your configuration to another directory. You can always restore your settings from that backup.
Back up your settings and restore the defaults

- Go to File | Manage IDE Settings | Restore Default Settings . Alternatively, press Shift twice and type Restore default settings .
- Click Restore and Restart . The IDE will be restarted with the default configuration.
When PyCharm restores the default IDE settings, it creates a backup directory with your configuration in:
Run/Debug Configuration: Python
When you run your application for the very first time, PyCharm automatically creates the temporary Run/Debug configuration. You can modify it to specify or alter the default parameters and save it as a permanent Run/Debug configuration.
Use this dialog to create a run/debug configuration for Python scripts .
Configuration tab
Script path/Module name
Click the list to select a type of target to run. Then, in the corresponding field, specify the path to the Python script or the module name to be executed.
You can use path variables in this field.
In this field, specify parameters to be passed to the Python script.
When specifying the script parameters, follow these rules:
- Use spaces to separate individual script parameters.
- Script parameters containing spaces should be delimited with double quotes, for example, some» «param or «some param» .
- If script parameter includes double quotes, escape the double quotes with backslashes, for example:
-s»main.snap_source_dirs=[\»pcomponents/src/main/python\»]» -s»http.cc_port=8189″ -s»backdoor.port=9189″ -s»main.metadata=»\"location\":>
In this field you can add a macros to pass various project- or context-specific values when running a run/debug configuration. Click + and select one of the available macros from the list. See Adding macros to run/debug configuration for more details.
Allow multiple instances
Select this option if you want to allow multiple instances of the configuration to run at the same time. If this option is disabled, attempting to re-run the configuration will terminate the active session.
Click this list to select one of the projects, opened in the same PyCharm window, where this run/debug configuration should be used. If there is only one open project, this field is not displayed.
This field shows the list of environment variables. If the list contains several variables, they are delimited with semicolons.
By default, the field contains the variable PYTHONUNBUFFERED set to 1. To fill in the list, click the browse button, or press Shift+Enter and specify the desired set of environment variables in the Environment Variables dialog.
To create a new variable, click , and type the desired name and value.
You might want to populate the list with the variables stored as a series of records in a text file, for example:
Variable1 = Value1 Variable2 = Value2
Just copy the list of variables from the text file and click Paste () in the Environmental Variables dialog. The variables will be added to the table. Click Ok to complete the task. At any time, you can select all variables in the Environment Variables dialog, click Copy , and paste them into a text file.
Paths to «.env» files
This field shows paths to .env files with environment variables. If there are several files, the paths to them are delimited with semicolons.
To manage the list of .env files, click Choose «.env» file . In the Environment Files dialog that opens, use Add and Remove to add and remove files.
You can also use and to change the order in which .env files are loaded.
Select one of the pre-configured Python interpreters from the list.
When PyCharm stops supporting any of the outdated Python versions, the corresponding Python interpreter is marked as unsupported.
In this field, specify the command-line options to be passed to the interpreter. If necessary, click , and type the string in the editor.
Specify a directory to be used by the running task.
- When a default run/debug configuration is created by the keyboard shortcut Control+Shift+F10 , or by choosing Run from the context menu of a script, the working directory is the one that contains the executable script. This directory may differ from the project directory.
- When this field is left blank, the bin directory of the PyCharm installation will be used.
You can use path variables in this field.
Add content roots to PYTHONPATH
Select this checkbox to add all content roots of your project to the environment variable PYTHONPATH;
Add source roots to PYTHONPATH
Select this checkbox to add all source roots of your project to the environment variable PYTHONPATH;
Emulate terminal in output console
Enables running your script or module in the output console with the emulated terminal mode. This mode can be helpful for the tasks that cannot be implemented with the standard output console, for example, when your script performs caret return actions ( print(i, flush=True , end=’\r’ ).
Note that emulating terminal in the output console differs from running the Terminal that is a separate tool window used for running system shell commands.
Run with Python console
Enables running your script or module with the Python console.
Redirect input from
Enables redirecting data from a text file to standard input. Use this option if your script requires some input and you want to automatically submit the values instead of typing them in the Run console. To enable redirecting, select the checkbox and specify the path to the target text file.
Docker container settings
This field only appears when a Docker-based remote interpreter is selected for a project..
Click to open the dialog and specify the following settings:
- Publish all ports : Expose all container ports to the host. This corresponds to the option —publish-all .
- Port bindings : Specify the list of port bindings. Similar to using the -p option with docker run .
- Volume bindings : Use this field to specify the bindings between the special folders- volumes and the folders of the computer, where the Docker daemon runs. This corresponds to the -v option. For more information, refer to Managing data in containers.
- Environment variables : Use this field to specify the list of environment variables and their values. This corresponds to the -e option. For more information, refer to ENV (environment variables).
- Run options : Use this field to specify the Docker command-line options.
Click to expand the tables. Click , , or to make up the lists.
This field only appears when a Docker Compose-based remote interpreter is selected.
Commands and options
You can use the following commands of the Docker Compose Command-Line Interface:
up: Builds, creates, starts, and attaches to containers for a service.
- —abort-on-container-exit
- —build
- —exit-code-from SERVICE
- —scale SERVICE=NUM.
- —timeout TIMEOUT
run: Runs a one-time command against a service.
- —entrypoint CMD
- -l, —label KEY=VAL
- —name NAME
- -p, —publish=[]
- —rm
- —service-ports
- —use-aliases
- -u, —user=»»
- -v, —volume=[]
exec: Runs arbitrary commands in your services.
Use this field to preview the complete command string.
For example, the up —build exec —user jetbrains combination in the Commands and options field produces the following output in the preview:
docker compose -f C:\PyCharm-2019.2\Demos\djangodocker-master\docker-compose.yml -f
Logs tab
Use this tab to specify which log files generated while running or debugging should be displayed in the console, that is, on the dedicated tabs of the Run or Debug tool window.
Select checkboxes in this column to have the log entries displayed in the corresponding tabs in the Run tool window or Debug tool window.
The read-only fields in this column list the log files to show. The list can contain:
- Full paths to specific files.
- Aliases to substitute for full paths or patterns. These aliases are also displayed in the headers of the tabs where the corresponding log files are shown. If a log entry pattern defines more than one file, the tab header shows the name of the file instead of the log entry alias.
Select this checkbox to have the previous content of the selected log skipped.
Save console output to file
Select this checkbox to save the console output to the specified location. Type the path manually, or click the browse button and point to the desired location in the dialog that opens.
Show console when a message is printed to standard output stream
Select this checkbox to activate the output console and bring it forward if an associated process writes to Standard.out.
Show console when a message is printed to standard error stream
Select this checkbox to activate the output console and bring it forward if an associated process writes to Standard.err.
Click this button to open the Edit Log Files Aliases dialog where you can select a new log entry and specify an alias for it.
Click this button to edit the properties of the selected log file entry in the Edit Log Files Aliases dialog.
Click this button to remove the selected log entry from the list.
Click this button to edit the select log file entry. The button is available only when an entry is selected.
Common settings
When you edit a run configuration (but not a run configuration template), you can specify the following options:
Specify a name for the run configuration to quickly identify it among others when editing or running.
Allow multiple instances
Allow running multiple instances of this run configuration in parallel.
By default, it is disabled, and when you start this configuration while another instance is still running, PyCharm suggests stopping the running instance and starting another one. This is helpful when a run configuration consumes a lot of resources and there is no good reason to run multiple instances.
Store as project file
Save the file with the run configuration settings to share it with other team members. The default location is .idea/runConfigurations . However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project.
By default, it is disabled, and PyCharm stores run configuration settings in .idea/workspace.xml .
Toolbar
The tree view of run/debug configurations has a toolbar that helps you manage configurations available in your project as well as adjust default configurations templates.
Share your IDE settings
PyCharm lets you share your IDE settings between different instances of PyCharm or even between different IntelliJ-based IDE products that you use. This helps you recreate a comfy working environment if you are working from different computers and spare the annoyance of things looking or behaving differently from what you are used to.
There are several ways to share your IDE settings:
- Via the Settings Sync plugin: it uses your JetBrains Account, which makes the synced settings available in all IDEs where you log in with that account. The settings you can sync include: IDE themes, keymaps, color schemes, system settings, UI settings, menus and toolbar settings, project view settings, editor settings, code completion settings, parameter name hints, live templates, code styles, and the list of enabled and disabled plugins.
- Via the Settings Repository plugin: it allows you to sync any configurable components (except for the list of enabled and disabled plugins) but requires setting up a Git repository with the settings you want to share. This option is useful if you want to enforce the same IDE settings among your team-members or to use your custom settings storage. Starting from version 2022.3, the Settings Repository plugin is not bundled with PyCharm. It is still available for installation in JetBrains Marketplace. For more information about setting up Settings Repository, refer to version 2022.2 of PyCharm documentation.
- By exporting the settings you want to share as a ZIP archive and then importing them to a different IDE installation. You can export your code style settings, Git settings, including registered GitHub accounts, the Debugger settings, Registry keys, look and feel, and more.
Share settings via the Settings Sync plugin
The IDE Settings Sync plugin was deprecated in PyCharm 2022.3. Instead, a new plugin, Settings Sync , is available and bundled in PyCharm 2022.3. The most notable changes include:
- The new plugin supports synchronization across all JetBrains IDEs.
- Settings Sync synchronizes the settings of plugins, including those of third-party plugins (plugin developers should enable it if they want the settings of their plugin to be synchronized by Settings Sync).
Install the IDE Settings Sync plugin
This functionality relies on the IDE Settings Sync plugin, which you need to install and enable.
- Press Control+Alt+S to open the IDE settings and then select Plugins .
- Open the Marketplace tab, find the IDE Settings Sync plugin, and click Install (restart the IDE if prompted).
Sync settings between IDE instances

- On the computer with the IDE instance containing the settings you want to share, sign in to either of the following:
- Your IDE: from the main menu choose Help | Register , choose to activate your license with the JetBrains Account and enter your credentials.
- Toolbox App: click the gear icon in the top right corner of the application, select Settings and click Log in . Note that by signing in to Toolbox App, you automatically sign in to all JetBrains products that you run.
- If, instead of the JetBrains account, you use an activation code or a license server to activate your PyCharm, press Control+Alt+S to open the IDE settings and select Settings Sync | Log in with JetBrains account to sign in to your JetBrains account.
- Press Control+Alt+S to open Settings , go to Settings Sync , and then click Enable Settings Sync . You can also enable and disable Settings Sync or access its settings by right-clicking the gear icon in the upper-right corner of the PyCharm window.
- In the Settings Sync dialog that opens, select the setting categories that you want to share. You can exclude some settings from synchronization by clicking Configure next to the settings. For example, you can exclude specific plugins if you do not want to sync them. Or you may want to keep local fonts for the editor instead of synchronizing them if your IDEs are installed on different operating systems where some fonts can be missing.
- The following step depends on whether there are synced settings linked to your JetBrains Account.

Click Push Settings to Account to override the settings stored on the JetBrains server with your local settings and use them as the shared ones.

Click Enable Sync .
Your local settings will be automatically synchronized with the settings stored on the JetBrains server each time you modify a setting and each time the JetBrains server receives setting updates from another IDE.
Plugin states are synchronized as follows:
- If a plugin is installed on both IDEs, Settings Sync synchronizes the plugin state (enabled or disabled) between the two IDEs.
- If a plugin is installed and enabled on one IDE but is not installed on the other IDE, Settings Sync will install it on the other IDE.
- If a plugin is installed and disabled on one IDE, and it is not installed on the other IDE, Settings Sync will not install it on the other IDE.
- If you uninstall a plugin, and it is installed on the other IDE, Settings Sync will disable but not uninstall it on the other IDE.
Enable settings synchronization across different IDE products
By default, your settings are synchronized across instances of the same IDE product only, for example, across your PyCharm instances. You can enable synchronization of settings across any IntelliJ-based IDE products where the Settings Sync plugin is enabled and where you log in using the same JetBrains account.

- Open the Settings dialog ( Control+Alt+S ), go to Settings Sync .
- In the Sync settings across list, select All JetBrains IDE products .
Disable settings synchronization
You can either disable settings synchronization for a single IDE or completely remove all settings from the JetBrains cloud server and disable synchronization for all IDEs connected to your JetBrains account.
![]()
- In the upper-right corner of the PyCharm window, click the gear icon and select Settings Sync is On .
- On the Settings Sync page that opens, click Disable Settings Sync .
- Confirm disabling settings synchronization. To disable synchronization on all of your IDEs, select Remove data from JB account and disable for all IDEs.
Settings synchronized with Settings Sync
This list describes settings categories that you can enable and disable on the Settings Sync page. The list is not comprehensive, but it gives you an overview of the IDE settings that compose each category.
- Appearance & Behavior | Appearance
- Appearance & Behavior | Menus and Toolbars
- Appearance & Behavior | Notifications
- Appearance & Behavior | Quick Lists
- Editor | Font
- Editor | Color Scheme
- Editor | General
- Editor | Code Editing
- Editor | Code Style
- Editor | File Encodings
- Editor | Live Templates
- Editor | File Types
- Editor | Inlay Hints
- Editor | Emmet
- Editor | Intentions
- Version Control
- Build, Execution, Deployment | Debugger
- Tools | Space
- Tools | Database
- Tools | CSV Formats
- Tools | Server Certificates
- Tools | Shared Indexes
- Appearance & Behavior | New UI
- Appearance & Behavior | System Settings
- Appearance & Behavior | System Settings | Date Formats
- Registry keys
Frequently Asked Questions
This section attempts to answer questions that you may have while using setting synchronization after the upgrade from PyCharm 2022.2 (or earlier) to PyCharm 2022.3.
I was using IDE Settings Sync in 2022.2 (or earlier). What will happen to my settings?
The settings will be migrated to the new Settings Sync plugin after you upgrade your IDE to 2022.3.
If I do not upgrade one of my IDE instances to 2022.3, will its settings be synchronized with the settings of those IDEs that I upgrade to 2022.3?
No. The new Settings Sync plugin requires your IDE to have version 2022.3 or later (for Rider, it is 2023.3 or later).
Will Settings Repository be available after 2022.3?
Yes. The Settings Repository plugin is not bundled in 2022.3, but you can still install it manually.
I use Settings Repository. What are my options after the upgrade to 2022.3?
Just as before, you cannot use Settings Repository and Settings Sync simultaneously. That is why, if you use Settings Repository, we won’t automatically enable the new Settings Sync after you upgrade to 2022.3. Instead, we will let you choose your preferred way to synchronize settings: You can either manually install Settings Repository or enable the new Settings Sync.
I have to use a custom storage for settings. What are my options?
Settings Sync stores settings on the JetBrains cloud server and currently does not provide a way to set up a custom storage. If you absolutely need a custom server to store settings, you can manually install Settings Repository and continue using it in 2022.3.
Is Settings Sync enabled by default?
No. However, it is automatically enabled if you have enabled the old IDE Settings Sync in your 2022.2 IDE and then upgraded it to 2022.3.
Does Settings Sync support synchronization of plugin settings?
Yes, but it should also be supported by the plugin itself. For more information, refer to IntelliJ Platform SDK documentation.
I have two IDE instances, and each of them is connected to a separate JetBrains Account (for example, because of different licenses). Can I synchronize settings across them?
No. In Settings Sync, your settings are linked to the JetBrains Account that you use to log in to the IDE. So, to be able to share settings, you need to log in to the same JetBrains Account in both IDEs. However, you can make licenses from one account to be available in another one by linking email addresses to a single JetBrains Account.
I disable synchronization of a plugin, but I still see its settings synced. How to disable it?
If you disable a plugin under Settings Sync | Plugins | Configure , you only disable synchronization of the plugin state (enabled or disabled). It does not affect the IDE settings provided by this plugin. Each IDE setting belongs to a category, so if you want to disable synchronization of a setting, you should disable the corresponding category (for example, UI settings or Tools ). The category to which a particular setting belongs is determined by the plugin developer.
Export your settings manually
Export settings to a ZIP archive
- Select File | Manage IDE Settings | Export Settings from the main menu.
- Select the settings you want to export and specify the path to the target archive.
Import settings from a ZIP archive
- Select File | Manage IDE Settings | Import Settings from the main menu.
- Select the ZIP archive that contains your settings in the dialog that opens.
- Select the settings you want to apply in the Select Components to Import dialog that opens and click OK .
Run/debug configurations
PyCharm uses run/debug configurations to run, debug, and test your code. Each configuration is a named set of startup properties that define what to execute and what parameters and environment should be used.
With different startup properties, you can define different ways that PyCharm uses to execute your script. For example, you can execute the same code with different Python interpreters, providing various sets of environment variables, and getting input values from alternative files.
There are two types of run/debug configurations:
- Temporary — created every time you run or debug functions or tests.
- Permanent — created explicitly from a template or by saving a temporary configuration. Permanent configurations remain as part of your project until you remove them.
So whenever you run/debug or test your code, PyCharm either uses an existing permanent run/debug configuration or creates a new temporary one.
Permanent configurations have opaque icons while the icons of temporary configurations are semi-transparent.
The maximum number of temporary configurations is 5. The older ones are automatically deleted when new ones are added. If necessary, you can increase this limit in Settings | Advanced Settings | Run/Debug | Temporary configurations limit .
Create permanent run/debug configurations
PyCharm provides the following ways to create a permanent run/debug configuration:
- Save a temporary run/debug configuration as permanent.
- Create from a template or copy an existing configuration.
Save a temporary configuration as permanent
- Select a temporary configuration in the run/debug configuration switcher, click / , and select Save Configuration . Once you save a temporary configuration, it becomes permanent and it is recorded in a separate XML file in the /.idea/ directory. For example, MyProject/.idea/Car.xml .
- Alternatively, select a temporary configuration in the Run/debug configurations dialog and click on the toolbar.
PyCharm provides run/debug configuration templates for different languages, tools, and frameworks. The list of available templates varies depending on the installed and enabled plugins.
Create a run/debug configuration from a template
- Go to Run | Edit Configurations . Alternatively, click in the Run widget and select Edit Configurations from the drop-down menu.

- In the Run/Debug Configuration dialog, click on the toolbar or press Alt+Insert . The list shows the run/debug configuration templates. Select Python .

- Specify the run/debug configuration name in the Name field. This name will be shown in the list of the available run/debug configurations.

- Configure the run/debug configuration parameters. The list of mandatory and optional parameters may vary depending on the selected run/debug configuration type. Some optional parameters are hidden. To view and enable them, click the Modify options link.
For the detailed description of the Python template, see Run/Debug configuration parameters. - You can either run the configuration right away, or save the configuration to run it later.
- Click OK to save the run configuration for later and close the dialog.
- To run the configuration right away, click Run .
Add a macro to a Python run/debug configuration
- Go to Run | Edit Configurations . Alternatively, click in the Run widget and select Edit Configurations from the drop-down menu.

- In the Run/Debug Configurations dialog, select the target configuration from the list of the Python run/debug configurations.
- Click Insert Macros in one of the following fields:
- Script path
- Parameters
- Working directory
- Select a macro from the list of the available macros.

- Click Insert to add the selected macro. See Pass parameters to the running script for an example of using a macro in a run/debug configuration.
Share run/debug configurations
If you are working in a team, you might want to share your run/debug configurations so that your teammates could run the application using the same configuration or enable them to remotely attach to the process you are running.
For these purposes, PyCharm provides a mechanism to store your run/debug configurations as project files and share them through VCS. The same mechanism can also be used when you want to send your configuration as a file to someone else. This saves a lot of time as run/debug configurations sometimes get sophisticated, and keeping them in sync manually would be tedious and error-prone.
Legacy .ipr -based projects do not support individual run/debug configurations. With legacy projects, you can only share all configurations at once by adding the .ipr file to the VCS.

- Go to Run | Edit Configurations . Alternatively, click in the Run widget and select Edit Configurations from the drop-down menu.
- Select the run/debug configuration you want to share, enable the Store as project file option, and specify the location where the configuration file will be stored. If compatibility with PyCharm 2019.3 and earlier is required, store the file in the default location.
- (Optional) If the .idea directory is added to VCS ignored files, the .idea/runConfigurations subfolder will be ignored, too. If you use Git for your project, you can share .idea/runConfigurations only and leave .idea ignored by modifying .gitignore as follows:
/.idea/* !/.idea/runConfigurations
Turning on the Store as project file option does not submit anything to the VCS for you. For run/debug configurations to make their way to a shared repository, you have to check them in like other versioned files.
Run/debug configuration templates
All run/debug configurations are based on templates, which implement the startup logic, define the list of parameters and their default values. The list of available templates is predefined in the installation and can only be extended via plugins. However, you can edit default parameter values in each template to streamline the setup of new run/debug configurations.
Changing the default values of a template does not affect already existing run/debug configurations.
Do not set up a working directory for the default Run/Debug Configurations listed under the Templates node. This may lead to unresolved targets in newly created Run/Debug Configurations.
Configure the default values for a template
- Go to Run | Edit Configurations . Alternatively, click in the Run widget and select Edit Configurations from the drop-down menu.

- In the left-hand pane of the run/debug configuration dialog, click Edit configuration templates… .

- In the Run/Debug Configuration Templates dialog that opens, select a configuration type.

- Specify the desired default parameters and click OK to save the template.
Run/debug configuration folders
When there are many run/debug configurations of the same type, you can group them in folders, so they become easier to distinguish visually.
Once grouped, the run/debug configurations appear in the list under the corresponding folders.

Create a folder for run/debug configurations
- Go to Run | Edit Configurations . Alternatively, click in the Run widget and select Edit Configurations from the drop-down menu.

- In the Run/Debug Configurations dialog, select a configuration type and click on the toolbar. A new empty folder for the selected type is created.

- Specify the folder name in the text field to the right or accept the default name.
- Select the desired run/debug configurations and move them under the target folder.
- Apply the changes. If a folder is empty, it will not be saved.
When you no longer need a folder, you can delete it Delete . The run/debug configurations grouped under this folder will be moved under the root of the corresponding run/debug configuration type.
Run/Debug configurations in the Services tool window
You can manage multiple run/debug configurations in the Services tool window. For example, you can start, pause, and stop several applications, track their status, and examine application-specific details.
Add Run/Debug configurations to the Services window

- Select View | Tool Windows | Services from the main menu or press Alt+8 .
- In the Services tool window, click Add service , then select Run Configuration Type… .
- Select a run/debug configuration type from the list to add all configurations of this type to the window. Note that the tool window will only display the configuration types for which you have created one or more configurations.
Run/Debug configuration parameters
Script path/Module name
Click the list to select a type of target to run. Then, in the corresponding field, specify the path to the Python script or the module name to be executed.
You can use path variables in this field.
In this field, specify parameters to be passed to the Python script.
When specifying the script parameters, follow these rules:
- Use spaces to separate individual script parameters.
- Script parameters containing spaces should be delimited with double quotes, for example, some» «param or «some param» .
- If script parameter includes double quotes, escape the double quotes with backslashes, for example:
-s»main.snap_source_dirs=[\»pcomponents/src/main/python\»]» -s»http.cc_port=8189″ -s»backdoor.port=9189″ -s»main.metadata=»\"location\":>
In this field you can add a macros to pass various project- or context-specific values when running a run/debug configuration. Click + and select one of the available macros from the list. See Adding macros to run/debug configuration for more details.
Allow multiple instances
Select this option if you want to allow multiple instances of the configuration to run at the same time. If this option is disabled, attempting to re-run the configuration will terminate the active session.
Click this list to select one of the projects, opened in the same PyCharm window, where this run/debug configuration should be used. If there is only one open project, this field is not displayed.
This field shows the list of environment variables. If the list contains several variables, they are delimited with semicolons.
By default, the field contains the variable PYTHONUNBUFFERED set to 1. To fill in the list, click the browse button, or press Shift+Enter and specify the desired set of environment variables in the Environment Variables dialog.
To create a new variable, click , and type the desired name and value.
You might want to populate the list with the variables stored as a series of records in a text file, for example:
Variable1 = Value1 Variable2 = Value2
Just copy the list of variables from the text file and click Paste () in the Environmental Variables dialog. The variables will be added to the table. Click Ok to complete the task. At any time, you can select all variables in the Environment Variables dialog, click Copy , and paste them into a text file.
Paths to «.env» files
This field shows paths to .env files with environment variables. If there are several files, the paths to them are delimited with semicolons.
To manage the list of .env files, click Choose «.env» file . In the Environment Files dialog that opens, use Add and Remove to add and remove files.
You can also use and to change the order in which .env files are loaded.
Select one of the pre-configured Python interpreters from the list.
When PyCharm stops supporting any of the outdated Python versions, the corresponding Python interpreter is marked as unsupported.
In this field, specify the command-line options to be passed to the interpreter. If necessary, click , and type the string in the editor.
Specify a directory to be used by the running task.
- When a default run/debug configuration is created by the keyboard shortcut Control+Shift+F10 , or by choosing Run from the context menu of a script, the working directory is the one that contains the executable script. This directory may differ from the project directory.
- When this field is left blank, the bin directory of the PyCharm installation will be used.
You can use path variables in this field.
Add content roots to PYTHONPATH
Select this checkbox to add all content roots of your project to the environment variable PYTHONPATH;
Add source roots to PYTHONPATH
Select this checkbox to add all source roots of your project to the environment variable PYTHONPATH;
Emulate terminal in output console
Enables running your script or module in the output console with the emulated terminal mode. This mode can be helpful for the tasks that cannot be implemented with the standard output console, for example, when your script performs caret return actions ( print(i, flush=True , end=’\r’ ).
Note that emulating terminal in the output console differs from running the Terminal that is a separate tool window used for running system shell commands.
Run with Python console
Enables running your script or module with the Python console.
Redirect input from
Enables redirecting data from a text file to standard input. Use this option if your script requires some input and you want to automatically submit the values instead of typing them in the Run console. To enable redirecting, select the checkbox and specify the path to the target text file.
Docker container settings
This field only appears when a Docker-based remote interpreter is selected for a project..
Click to open the dialog and specify the following settings:
- Publish all ports : Expose all container ports to the host. This corresponds to the option —publish-all .
- Port bindings : Specify the list of port bindings. Similar to using the -p option with docker run .
- Volume bindings : Use this field to specify the bindings between the special folders- volumes and the folders of the computer, where the Docker daemon runs. This corresponds to the -v option. For more information, refer to Managing data in containers.
- Environment variables : Use this field to specify the list of environment variables and their values. This corresponds to the -e option. For more information, refer to ENV (environment variables).
- Run options : Use this field to specify the Docker command-line options.
Click to expand the tables. Click , , or to make up the lists.
This field only appears when a Docker Compose-based remote interpreter is selected.
Commands and options
You can use the following commands of the Docker Compose Command-Line Interface:
up: Builds, creates, starts, and attaches to containers for a service.
- —abort-on-container-exit
- —build
- —exit-code-from SERVICE
- —scale SERVICE=NUM.
- —timeout TIMEOUT
run: Runs a one-time command against a service.
- —entrypoint CMD
- -l, —label KEY=VAL
- —name NAME
- -p, —publish=[]
- —rm
- —service-ports
- —use-aliases
- -u, —user=»»
- -v, —volume=[]
exec: Runs arbitrary commands in your services.
Use this field to preview the complete command string.
For example, the up —build exec —user jetbrains combination in the Commands and options field produces the following output in the preview:
docker compose -f C:\PyCharm-2019.2\Demos\djangodocker-master\docker-compose.yml -f