Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Visual Studio provides support for configuring the interactive development environment (IDE) for Python development. You can set options according to your preference and to meet specific development environment needs. This article describes options available for general layout and behavior, debugging, diagnostics, and advanced Python language features.
Location of Python options
Python configuration settings are available from the Visual Studio toolbar under Tools > Options. The Options dialog lists most settings for Python on the Python tab:
The Options dialog lists other Python settings under Text Editor > Python. There are options for scroll bars, tabs, and formatting, along with general and advanced settings. Other settings are available under Environment > Fonts and Colors for the Text Editor settings group.
Note
The Options dialog might include an Experimental tab or group for features under development that aren't described in this article. You can find more information in posts on the Python engineering at Microsoft blog.
Specific options for Python
Under Tools > Options > Python, you can set Python-specific options for the general environment including Interactive Windows, conda environments, debugging, and more.
General Python options
The following options are available under Tools > Options > Python> General:
Conda environment options
The following options are available under Tools > Options > Python> Conda:
| Option | Default | Description |
|---|---|---|
| Conda executable path | (blank) | Specifies an exact path to the conda.exe executable rather than relying on the default Miniconda installation included with the Python workload. If another path is given here, it takes precedence over the default installation and any other conda.exe executables specified in the registry. You might change this setting if you manually install a newer version of Anaconda or Miniconda, or want to use a 32-bit distro rather than the default 64-bit distro. |
Debugging options
The following options are available under Tools > Options > Python> Debugging:
Interactive Windows options
The following options are available under Tools > Options > Python> Interactive Windows:
| Option | Default | Description |
|---|---|---|
| Scripts | n/a | Specifies a general folder for startup scripts to apply to Interactive Windows for all environments. For more information, see Startup scripts. Note: This feature might not work in your version of Visual Studio. |
| Up/down arrows navigate history | On | Uses the arrow keys to navigate through history in the Interactive window. Clear this setting to use the arrow keys to navigate within the Interactive window's output instead. |
| Completion mode | Only evaluate expressions without function calls | The process of determining the available members on an expression in the Interactive window might require evaluating the current unfinished expression, which can result in side-effects or functions being called multiple times. The default setting, Only evaluate expressions without function calls excludes expressions that appear to call a function, but evaluates other expressions. For example, it evaluates the statement a.b but not the a().b statement. Never evaluate expressions prevents all side-effects, using only the normal IntelliSense engine for suggestions. Evaluate all expressions evaluates the complete expression to obtain suggestions, regardless of side effects. |
| Hide static analysis suggestions | Off | When set, displays only suggestions that are obtained by evaluating the expression. If combined with the Completion mode value Never evaluate expressions, no useful completions appear in the Interactive window. |
Text editor options for Python
Under Text Editor > Python, there are options for scroll bars, tabs, and formatting, along with general and advanced settings:
General Python editor options
The following options are available under Tools > Options > Text Editor > Python > General:
| Option | Default | Description |
|---|---|---|
| Auto list members | On | Set this option to automatically list members for completion of code statements. |
| Hide advanced members | On | When the Auto list members option is enabled, set this option to hide advanced members from the completion suggestions. Advanced members are members that are used less frequently than others. |
| Parameter information | On | When set, hovering over parameters shows detailed information, such as the item definition and links to documentation. |
| Enable virtual space | On | When set, inserts spaces at the end of each line of code. Select this option to position comments at a consistent point next to your code. The Virtual Space mode is enabled in Column Selection mode. When Virtual Space mode isn't enabled, the insertion point moves from the end of one line directly to the first character of the next line. Note: This option is influenced by the Text Editor > All Languages > General > Enable virtual space global setting. If the global setting isn't enabled, this option can't be enabled at the language level. |
| Word wrap | Off | Set this option to allow long lines of code to wrap based on the editors viewport width. |
| Show visual glyphs for word wrap | Off | When the Word wrap option is enabled, set this option to show visual glyphs. |
| Line numbers | Off | Set this option to show line numbers in the left margin of the editor for each line of code. |
| Enable single-click URL navigation | On | When set, you can single-click a URL to browse to the target location. |
| Navigation bar | Off | Set this option to enable the dropdown boxes at the top of the code window. These fields help you navigate to code in a codebase where you can choose a type or member to go directly to. Note: This option is influenced by the Text Editor > All Languages > General > Enable navigation bar global setting. For more information, see Navigate code> Navigation bar. |
| Automatic brace completion | On | When set, Visual Studio automatically adds the closing brace for any open brace as you enter code. |
| Apply Cut or Copy to blank lines when there is no selection | On | By default, Visual Studio cuts or copies the entire line of code when there's no explicit selection. Use this option to enable or disable this Cut or Copy behavior when invoked on blank lines. |
For more information, see Options dialog box: Text Editor > General.
Advanced Python editor options
The following options are available under Tools > Options > Text Editor > Python > Advanced:
Fonts and Colors options
Other Python options are available under Environment > Fonts and Colors when the Text Editor group is set to Python:
The names of the Python options are all prefixed with "Python" and are self-explanatory. The default font for all Visual Studio color themes is 10 pt Consolas regular (not bold). The default colors vary by theme. Typically, you change a font or color to make it easier to read text.