CINXE.COM

Settings Reference for Python

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="awa-expId" content="vscw_aaflight1016_control:103441;" /> <meta name="awa-env" content="prod" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="google-site-verification" content="hNs7DXrTySP_X-0P_AC0WulAXvUwgSXEmgfcO2r79dw" /> <!-- Twitter and Facebook OpenGraph Metadata--> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:site" content="@code" /> <meta name="description" content="Settings Reference for the Python extension in Visual Studio Code" /> <meta name="keywords" content="" /> <meta name="ms.prod" content="vs-code" /> <meta name="ms.TOCTitle" content="Settings Reference" /> <meta name="ms.ContentId" content="d256dc5c-95e9-4c02-a82f-947bf34a3517" /> <meta name="ms.date" content="3/6/2023" /> <meta name="ms.topic" content="conceptual" /> <!-- Twitter and Facebook OpenGraph Metadata--> <meta name="twitter:card" content="summary_large_image" /> <meta property="og:url" content="https://code.visualstudio.com/docs/python/settings-reference" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Settings Reference for Python" /> <meta property="og:description" content="Settings Reference for the Python extension in Visual Studio Code" /> <meta property="og:image" content="https://code.visualstudio.com/assets/docs/python/tutorial/python-social.png" /> <link rel="shortcut icon" href="/favicon.ico" sizes="128x128" /> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <title>Settings Reference for Python</title> <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="/dist/v2/style.css"> <script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script> <script type="text/javascript" src="https://js.monitor.azure.com/scripts/c/ms.analytics-web-4.min.js"></script> <script type="text/javascript"> // Leave as var; siteConsent is initialized and referenced elsewhere. var siteConsent = null; const GPC_DataSharingOptIn = false; WcpConsent.onInitCallback(function () { window.appInsights = new oneDS.ApplicationInsights(); window.appInsights.initialize({ instrumentationKey: "1a3eb3104447440391ad5f2a6ee06a0a-62879566-bc58-4741-9650-302bf2af703f-7103", propertyConfiguration: { userConsented: false, gpcDataSharingOptIn: false, callback: { userConsentDetails: siteConsent ? siteConsent.getConsent : undefined }, }, cookieCfg: { ignoreCookies: ["MSCC"] }, webAnalyticsConfiguration:{ // Web Analytics Plugin configuration urlCollectQuery: true, urlCollectHash: true, autoCapture: { scroll: true, pageView: true, onLoad: true, onUnload: true, click: true, resize: true, jsError: true } } }, []); window.appInsights.getPropertyManager().getPropertiesContext().web.gpcDataSharingOptIn = GPC_DataSharingOptIn; }); </script> <link rel="alternate" type="application/atom+xml" title="RSS Feed for code.visualstudio.com" href="/feed.xml" /> </head> <body > <!-- Setting theme here to avoid FOUC --> <script> function setTheme(themeName) { if (themeName === 'dark') { document.documentElement.removeAttribute('data-theme'); // dark is default, so no data-theme attribute needed } if (themeName === 'light') { document.documentElement.setAttribute('data-theme', themeName); } return; } // Determine initial theme: user preference or system preference let theme = localStorage.getItem('theme') || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'); setTheme(theme); // Apply the initial theme // Listen for changes in the system theme preference window.matchMedia('(prefers-color-scheme: dark)').addListener(e => { if (!localStorage.getItem('theme')) { // Only if no user preference is saved setTheme(e.matches ? 'dark' : 'light'); } }); </script> <div id="main"> <div class="navbar-fixed-container"> <div class="navbar navbar-inverse navbar-fixed-top " data-spy="affix" data-offset-top="1"> <div id='cookie-banner'></div> <nav role="navigation" aria-label="Top Level"> <div class="container"> <div class="nav navbar-header"> <a class="navbar-brand" href="/"><span>Visual Studio Code</span></a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" aria-label="Expand and Collapse Menu"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-left"> <li class="active" ><a id="nav-docs" href="/docs">Docs</a></li> <li ><a id="nav-updates" href="/updates">Updates</a></li> <li ><a id="nav-blogs" href="/blogs">Blog</a></li> <li ><a id="nav-extend" href="/api">API</a></li> <li><a href="https://marketplace.visualstudio.com/VSCode" target="_blank" rel="noopener" id="nav-extensions">Extensions</a></li> <li ><a id="nav-faqs" href="/docs/supporting/faq">FAQ</a></li> <li class='search visible-xs visible-sm' ><a href="/Search">Search</a></li> <li ><a id="nav-copilot" href="/docs/copilot/overview">GitHub Copilot</a></li> </ul> </ul> <ul class="nav navbar-nav navbar-right" role="presentation"> <li> <button type="button" class="theme-switch" id="theme-toggle"> <img class="theme-icon-light" src="/assets/icons/theme-light.svg" alt="Switch to the dark theme" /> <img class="theme-icon-dark" src="/assets/icons/theme-dark.svg" alt="Switch to the light theme" /> </button> </li> <li> <a href="/Search" title="Search" class="btn search-btn" id="nav-search"> <img class="search-icon-light" src="/assets/icons/search.svg" width="16px" height="16px" alt="Search" /> <img class="search-icon-dark" src="/assets/icons/search-dark.svg" width="16px" height="16px" alt="Search" /> </a> </li> <li class="search" role="presentation"> <form class="nav-search search-form" role="search" aria-label="Search"> <div class="input-group" role="presentation"> <input type="text" name="q" class="search-box form-control" placeholder="Search Docs" aria-label="Search text"/> <span class="input-group-btn"> <button tabindex="0" class="btn" type="submit" aria-label="Search"> <img class="search-icon-dark" src="/assets/icons/search-dark.svg" alt="Search" /> <img class="search-icon-light" src="/assets/icons/search.svg" alt="Search" /> </button> </span> </div> </form> </li> <!-- this was hiden in the home and download page, keeping it for now --> <li><a class="link-button" href="/Download" id="nav-download"> <span>Download</span></a></li> </ul> </div> </div> </nav> </div> </div> <div class="updates-banner "> <div class="container"> <p class="message"><a href="/updates" id="banner-link-updates">Version 1.95</a> is now available! Read about the new features and fixes from October.</p> </div> <div tabindex="0" role="button" title="Dismiss this update" class="dismiss-btn" id="banner-dismiss-btn"><span class="sr-only">Dismiss this update</span><span aria-hidden="true" class="glyph-icon"></span></div> </div> <!-- This div wraps around the entire site --> <!-- The body itself should already have a main tag --> <div id="main-content"> <script> function closeReportIssue() { var element = document.getElementById('surveypopup'); element.parentElement.removeChild(element); } function reportIssue(tutorial, page) { var div = document.createElement('div'); div.innerHTML = '<div id="surveypopup" class="overlay visible"><div class="surveypopup"><div id="surveytitle">Tell us more<a href="javascript:void(0)" onclick="closeReportIssue()">X</a></div><div id="surveydiv"><iframe frameBorder="0" scrolling="0" src="https://www.research.net/r/PWZWZ52?tutorial=' + tutorial + '&step=' + page + '"></iframe></div></div></div>'; document.body.appendChild(div.children[0]); } </script> <div class="container body-content docs"> <div class="row"> <!-- left nav --> <div class="col-xs-12 col-md-2 docs-navbar-container"> <nav id="docs-navbar" aria-label="Topics" class="docs-nav visible-md visible-lg"> <ul class="nav" id="main-nav"> <li > <a class="docs-home" href="/docs" >Overview</a> </li> <li class="panel collapsed"> <a class="area" role="button" href="#setup-articles" data-parent="#main-nav" data-toggle="collapse">Setup</a> <ul id="setup-articles" class="collapse "> <li > <a href="/docs/setup/setup-overview" >Overview</a> </li> <li > <a href="/docs/setup/linux" >Linux</a> </li> <li > <a href="/docs/setup/mac" >macOS</a> </li> <li > <a href="/docs/setup/windows" >Windows</a> </li> <li > <a href="/docs/setup/raspberry-pi" >Raspberry Pi</a> </li> <li > <a href="/docs/setup/network" >Network</a> </li> <li > <a href="/docs/setup/additional-components" >Additional Components</a> </li> <li > <a href="/docs/setup/enterprise" >Enterprise</a> </li> <li > <a href="/docs/setup/uninstall" >Uninstall</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#getstarted-articles" data-parent="#main-nav" data-toggle="collapse">Get Started</a> <ul id="getstarted-articles" class="collapse "> <li > <a href="/docs/getstarted/getting-started" >Tutorial</a> </li> <li > <a href="/docs/getstarted/introvideos" >Intro Videos</a> </li> <li > <a href="/docs/getstarted/tips-and-tricks" >Tips and Tricks</a> </li> <li > <a href="/docs/getstarted/userinterface" >User Interface</a> </li> <li > <a href="/docs/getstarted/themes" >Themes</a> </li> <li > <a href="/docs/getstarted/settings" >Settings</a> </li> <li > <a href="/docs/getstarted/keybindings" >Key Bindings</a> </li> <li > <a href="/docs/getstarted/locales" >Display Language</a> </li> <li > <a href="/docs/getstarted/telemetry" >Telemetry</a> </li> <li > <a href="/docs/getstarted/educators-and-students" >Educators & Students</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#editor-articles" data-parent="#main-nav" data-toggle="collapse">User Guide</a> <ul id="editor-articles" class="collapse "> <li > <a href="/docs/editor/codebasics" >Basic Editing</a> </li> <li > <a href="/docs/editor/extension-marketplace" >Extension Marketplace</a> </li> <li > <a href="/docs/editor/intellisense" >IntelliSense</a> </li> <li > <a href="/docs/editor/editingevolved" >Code Navigation</a> </li> <li > <a href="/docs/editor/refactoring" >Refactoring</a> </li> <li > <a href="/docs/editor/debugging" >Debugging</a> </li> <li > <a href="/docs/editor/testing" >Testing</a> </li> <li > <a href="/docs/editor/vscode-web" >VS Code for the Web</a> </li> <li > <a href="/docs/editor/tasks" >Tasks</a> </li> <li > <a href="/docs/editor/profiles" >Profiles</a> </li> <li > <a href="/docs/editor/settings-sync" >Settings Sync</a> </li> <li > <a href="/docs/editor/userdefinedsnippets" >Snippets</a> </li> <li > <a href="/docs/editor/emmet" >Emmet</a> </li> <li > <a href="/docs/editor/command-line" >Command Line Interface</a> </li> <li > <a href="/docs/editor/workspaces" >Workspaces</a> </li> <li > <a href="/docs/editor/workspace-trust" >Workspace Trust</a> </li> <li > <a href="/docs/editor/multi-root-workspaces" >Multi-root Workspaces</a> </li> <li > <a href="/docs/editor/accessibility" >Accessibility</a> </li> <li > <a href="/docs/editor/voice" >Voice Interactions</a> </li> <li > <a href="/docs/editor/custom-layout" >Custom Layout</a> </li> <li > <a href="/docs/editor/port-forwarding" >Port Forwarding</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#sourcecontrol-articles" data-parent="#main-nav" data-toggle="collapse">Source Control</a> <ul id="sourcecontrol-articles" class="collapse "> <li > <a href="/docs/sourcecontrol/overview" >Overview</a> </li> <li > <a href="/docs/sourcecontrol/intro-to-git" >Introduction to Git</a> </li> <li > <a href="/docs/sourcecontrol/github" >Collaborate on GitHub</a> </li> <li > <a href="/docs/sourcecontrol/faq" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#terminal-articles" data-parent="#main-nav" data-toggle="collapse">Terminal</a> <ul id="terminal-articles" class="collapse "> <li > <a href="/docs/terminal/getting-started" >Getting Started Tutorial</a> </li> <li > <a href="/docs/terminal/basics" >Terminal Basics</a> </li> <li > <a href="/docs/terminal/profiles" >Terminal Profiles</a> </li> <li > <a href="/docs/terminal/shell-integration" >Shell Integration</a> </li> <li > <a href="/docs/terminal/appearance" >Appearance</a> </li> <li > <a href="/docs/terminal/advanced" >Advanced</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#copilot-articles" data-parent="#main-nav" data-toggle="collapse">GitHub Copilot</a> <ul id="copilot-articles" class="collapse "> <li > <a href="/docs/copilot/overview" >Overview</a> </li> <li > <a href="/docs/copilot/copilot-vscode-features" >Copilot Cheat Sheet</a> </li> <li > <a href="/docs/copilot/setup" >Setup</a> </li> <li > <a href="/docs/copilot/getting-started" >Quickstart</a> </li> <li > <a href="/docs/copilot/ai-powered-suggestions" >Code Completions</a> </li> <li > <a href="/docs/copilot/copilot-chat" >Copilot Chat</a> </li> <li > <a href="/docs/copilot/getting-started-chat" >Copilot Chat Tutorial</a> </li> <li > <a href="/docs/copilot/copilot-edits" >Copilot Edits</a> </li> <li > <a href="/docs/copilot/prompt-crafting" >Best Practices</a> </li> <li > <a href="/docs/copilot/workspace-context" >Workspace Context</a> </li> <li > <a href="/docs/copilot/copilot-customization" >Customizing Copilot</a> </li> <li > <a href="/docs/copilot/copilot-extensibility-overview" >Copilot Extensibility</a> </li> <li > <a href="/docs/copilot/copilot-settings" >Settings Reference</a> </li> <li > <a href="/docs/copilot/faq" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#languages-articles" data-parent="#main-nav" data-toggle="collapse">Languages</a> <ul id="languages-articles" class="collapse "> <li > <a href="/docs/languages/overview" >Overview</a> </li> <li > <a href="/docs/languages/javascript" >JavaScript</a> </li> <li > <a href="/docs/languages/json" >JSON</a> </li> <li > <a href="/docs/languages/html" >HTML</a> </li> <li > <a href="/docs/languages/css" >CSS, SCSS and Less</a> </li> <li > <a href="/docs/languages/typescript" >TypeScript</a> </li> <li > <a href="/docs/languages/markdown" >Markdown</a> </li> <li > <a href="/docs/languages/powershell" >PowerShell</a> </li> <li > <a href="/docs/languages/cpp" >C++</a> </li> <li > <a href="/docs/languages/java" >Java</a> </li> <li > <a href="/docs/languages/php" >PHP</a> </li> <li > <a href="/docs/languages/python" >Python</a> </li> <li > <a href="/docs/languages/julia" >Julia</a> </li> <li > <a href="/docs/languages/r" >R</a> </li> <li > <a href="/docs/languages/ruby" >Ruby</a> </li> <li > <a href="/docs/languages/rust" >Rust</a> </li> <li > <a href="/docs/languages/go" >Go</a> </li> <li > <a href="/docs/languages/tsql" >T-SQL</a> </li> <li > <a href="/docs/languages/csharp" >C#</a> </li> <li > <a href="/docs/languages/dotnet" >.NET</a> </li> <li > <a href="/docs/languages/polyglot" >Polyglot</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#nodejs-articles" data-parent="#main-nav" data-toggle="collapse">Node.js / JavaScript</a> <ul id="nodejs-articles" class="collapse "> <li > <a href="/docs/nodejs/working-with-javascript" >Working with JavaScript</a> </li> <li > <a href="/docs/nodejs/nodejs-tutorial" >Node.js Tutorial</a> </li> <li > <a href="/docs/nodejs/nodejs-debugging" >Node.js Debugging</a> </li> <li > <a href="/docs/nodejs/nodejs-deployment" >Deploy Node.js Apps</a> </li> <li > <a href="/docs/nodejs/browser-debugging" >Browser Debugging</a> </li> <li > <a href="/docs/nodejs/angular-tutorial" >Angular Tutorial</a> </li> <li > <a href="/docs/nodejs/reactjs-tutorial" >React Tutorial</a> </li> <li > <a href="/docs/nodejs/vuejs-tutorial" >Vue Tutorial</a> </li> <li > <a href="/docs/nodejs/debugging-recipes" >Debugging Recipes</a> </li> <li > <a href="/docs/nodejs/profiling" >Performance Profiling</a> </li> <li > <a href="/docs/nodejs/extensions" >Extensions</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#typescript-articles" data-parent="#main-nav" data-toggle="collapse">TypeScript</a> <ul id="typescript-articles" class="collapse "> <li > <a href="/docs/typescript/typescript-tutorial" >Tutorial</a> </li> <li > <a href="/docs/typescript/typescript-compiling" >Compiling</a> </li> <li > <a href="/docs/typescript/typescript-editing" >Editing</a> </li> <li > <a href="/docs/typescript/typescript-refactoring" >Refactoring</a> </li> <li > <a href="/docs/typescript/typescript-debugging" >Debugging</a> </li> </ul> </li> <li class="panel active expanded"> <a class="area" role="button" href="#python-articles" data-parent="#main-nav" data-toggle="collapse">Python</a> <ul id="python-articles" class="collapse in"> <li > <a href="/docs/python/python-quick-start" >Quick Start</a> </li> <li > <a href="/docs/python/python-tutorial" >Tutorial</a> </li> <li > <a href="/docs/python/run" >Run Python Code</a> </li> <li > <a href="/docs/python/editing" >Editing Code</a> </li> <li > <a href="/docs/python/linting" >Linting</a> </li> <li > <a href="/docs/python/formatting" >Formatting</a> </li> <li > <a href="/docs/python/debugging" >Debugging</a> </li> <li > <a href="/docs/python/environments" >Environments</a> </li> <li > <a href="/docs/python/testing" >Testing</a> </li> <li > <a href="/docs/python/jupyter-support-py" >Python Interactive</a> </li> <li > <a href="/docs/python/tutorial-django" >Django Tutorial</a> </li> <li > <a href="/docs/python/tutorial-fastapi" >FastAPI Tutorial</a> </li> <li > <a href="/docs/python/tutorial-flask" >Flask Tutorial</a> </li> <li > <a href="/docs/python/tutorial-create-containers" >Create containers</a> </li> <li > <a href="/docs/python/python-on-azure" >Deploy Python Apps</a> </li> <li > <a href="/docs/python/python-web" >Python in the Web</a> </li> <li class="active"> <a href="/docs/python/settings-reference" aria-label="Current Page: Settings Reference">Settings Reference</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#java-articles" data-parent="#main-nav" data-toggle="collapse">Java</a> <ul id="java-articles" class="collapse "> <li > <a href="/docs/java/java-tutorial" >Getting Started</a> </li> <li > <a href="/docs/java/java-editing" >Navigate and Edit</a> </li> <li > <a href="/docs/java/java-refactoring" >Refactoring</a> </li> <li > <a href="/docs/java/java-linting" >Formatting and Linting</a> </li> <li > <a href="/docs/java/java-project" >Project Management</a> </li> <li > <a href="/docs/java/java-build" >Build Tools</a> </li> <li > <a href="/docs/java/java-debugging" >Run and Debug</a> </li> <li > <a href="/docs/java/java-testing" >Testing</a> </li> <li > <a href="/docs/java/java-spring-boot" >Spring Boot</a> </li> <li > <a href="/docs/java/java-tomcat-jetty" >Application Servers</a> </li> <li > <a href="/docs/java/java-on-azure" >Deploy Java Apps</a> </li> <li > <a href="/docs/java/java-gui" >GUI Applications</a> </li> <li > <a href="/docs/java/extensions" >Extensions</a> </li> <li > <a href="/docs/java/java-faq" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#cpp-articles" data-parent="#main-nav" data-toggle="collapse">C++</a> <ul id="cpp-articles" class="collapse "> <li > <a href="/docs/cpp/introvideos-cpp" >Intro Videos</a> </li> <li > <a href="/docs/cpp/config-linux" >GCC on Linux</a> </li> <li > <a href="/docs/cpp/config-mingw" >GCC on Windows</a> </li> <li > <a href="/docs/cpp/config-wsl" >GCC on Windows Subsystem for Linux</a> </li> <li > <a href="/docs/cpp/config-clang-mac" >Clang on macOS</a> </li> <li > <a href="/docs/cpp/config-msvc" >Microsoft C++ on Windows</a> </li> <li > <a href="/docs/cpp/build-with-cmake" >Build with CMake</a> </li> <li > <a href="/docs/cpp/cmake-linux" >CMake Tools on Linux</a> </li> <li > <a href="/docs/cpp/cmake-quickstart" >CMake Quick Start</a> </li> <li > <a href="/docs/cpp/cpp-ide" >Editing and Navigating</a> </li> <li > <a href="/docs/cpp/cpp-debug" >Debugging</a> </li> <li > <a href="/docs/cpp/cpp-refactoring" >Refactoring</a> </li> <li > <a href="/docs/cpp/launch-json-reference" >Configure debugging</a> </li> <li > <a href="/docs/cpp/customize-default-settings-cpp" >Settings</a> </li> <li > <a href="/docs/cpp/configure-intellisense" >Configure IntelliSense</a> </li> <li > <a href="/docs/cpp/configure-intellisense-crosscompilation" >Configure IntelliSense for cross-compiling</a> </li> <li > <a href="/docs/cpp/faq-cpp" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#csharp-articles" data-parent="#main-nav" data-toggle="collapse">C#</a> <ul id="csharp-articles" class="collapse "> <li > <a href="/docs/csharp/introvideos-csharp" >Intro Videos</a> </li> <li > <a href="/docs/csharp/get-started" >Get Started</a> </li> <li > <a href="/docs/csharp/navigate-edit" >Navigate and Edit</a> </li> <li > <a href="/docs/csharp/intellicode" >IntelliCode</a> </li> <li > <a href="/docs/csharp/refactoring" >Refactoring</a> </li> <li > <a href="/docs/csharp/formatting-linting" >Formatting and Linting</a> </li> <li > <a href="/docs/csharp/project-management" >Project Management</a> </li> <li > <a href="/docs/csharp/build-tools" >Build Tools</a> </li> <li > <a href="/docs/csharp/package-management" >Package Management</a> </li> <li > <a href="/docs/csharp/debugging" >Run and Debug</a> </li> <li > <a href="/docs/csharp/testing" >Testing</a> </li> <li > <a href="/docs/csharp/cs-dev-kit-faq" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#containers-articles" data-parent="#main-nav" data-toggle="collapse">Docker</a> <ul id="containers-articles" class="collapse "> <li > <a href="/docs/containers/overview" >Overview</a> </li> <li > <a href="/docs/containers/quickstart-node" >Node.js</a> </li> <li > <a href="/docs/containers/quickstart-python" >Python</a> </li> <li > <a href="/docs/containers/quickstart-aspnet-core" >ASP.NET Core</a> </li> <li > <a href="/docs/containers/debug-common" >Debug</a> </li> <li > <a href="/docs/containers/docker-compose" >Docker Compose</a> </li> <li > <a href="/docs/containers/quickstart-container-registries" >Registries</a> </li> <li > <a href="/docs/containers/app-service" >Deploy to Azure</a> </li> <li > <a href="/docs/containers/choosing-dev-environment" >Choose a dev environment</a> </li> <li > <a href="/docs/containers/reference" >Customize</a> </li> <li > <a href="/docs/containers/bridge-to-kubernetes" >Develop with Kubernetes</a> </li> <li > <a href="/docs/containers/troubleshooting" >Tips and Tricks</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#datascience-articles" data-parent="#main-nav" data-toggle="collapse">Data Science</a> <ul id="datascience-articles" class="collapse "> <li > <a href="/docs/datascience/overview" >Overview</a> </li> <li > <a href="/docs/datascience/jupyter-notebooks" >Jupyter Notebooks</a> </li> <li > <a href="/docs/datascience/data-science-tutorial" >Data Science Tutorial</a> </li> <li > <a href="/docs/datascience/python-interactive" >Python Interactive</a> </li> <li > <a href="/docs/datascience/data-wrangler-quick-start" >Data Wrangler Quick Start</a> </li> <li > <a href="/docs/datascience/data-wrangler" >Data Wrangler</a> </li> <li > <a href="/docs/datascience/pytorch-support" >PyTorch Support</a> </li> <li > <a href="/docs/datascience/azure-machine-learning" >Azure Machine Learning</a> </li> <li > <a href="/docs/datascience/jupyter-kernel-management" >Manage Jupyter Kernels</a> </li> <li > <a href="/docs/datascience/notebooks-web" >Jupyter Notebooks on the web</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#azure-articles" data-parent="#main-nav" data-toggle="collapse">Azure</a> <ul id="azure-articles" class="collapse "> <li > <a href="/docs/azure/overview" >Overview</a> </li> <li > <a href="/docs/azure/gettingstarted" >Getting Started</a> </li> <li > <a href="/docs/azure/deployment" >Deployment</a> </li> <li > <a href="/docs/azure/docker" >Docker</a> </li> <li > <a href="/docs/azure/aksextensions" >Azure Kubernetes Service</a> </li> <li > <a href="/docs/azure/kubernetes" >Kubernetes</a> </li> <li > <a href="/docs/azure/mongodb" >MongoDB</a> </li> <li > <a href="/docs/azure/remote-debugging" >Remote Debugging for Node.js</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#remote-articles" data-parent="#main-nav" data-toggle="collapse">Remote</a> <ul id="remote-articles" class="collapse "> <li > <a href="/docs/remote/remote-overview" >Overview</a> </li> <li > <a href="/docs/remote/ssh" >SSH</a> </li> <li > <a href="/docs/remote/dev-containers" >Dev Containers</a> </li> <li > <a href="/docs/remote/wsl" >Windows Subsystem for Linux</a> </li> <li > <a href="/docs/remote/codespaces" >GitHub Codespaces</a> </li> <li > <a href="/docs/remote/vscode-server" >VS Code Server</a> </li> <li > <a href="/docs/remote/tunnels" >Tunnels</a> </li> <li > <a href="/docs/remote/ssh-tutorial" >SSH Tutorial</a> </li> <li > <a href="/docs/remote/wsl-tutorial" >WSL Tutorial</a> </li> <li > <a href="/docs/remote/troubleshooting" >Tips and Tricks</a> </li> <li > <a href="/docs/remote/faq" >FAQ</a> </li> </ul> </li> <li class="panel collapsed"> <a class="area" role="button" href="#devcontainers-articles" data-parent="#main-nav" data-toggle="collapse">Dev Containers</a> <ul id="devcontainers-articles" class="collapse "> <li > <a href="/docs/devcontainers/containers" >Overview</a> </li> <li > <a href="/docs/devcontainers/tutorial" >Tutorial</a> </li> <li > <a href="/docs/devcontainers/attach-container" >Attach to Container</a> </li> <li > <a href="/docs/devcontainers/create-dev-container" >Create a Dev Container</a> </li> <li > <a href="/docs/devcontainers/containers-advanced" >Advanced Containers</a> </li> <li > <a href="/docs/devcontainers/devcontainerjson-reference" >devcontainer.json</a> </li> <li > <a href="/docs/devcontainers/devcontainer-cli" >Dev Container CLI</a> </li> <li > <a href="/docs/devcontainers/tips-and-tricks" >Tips and Tricks</a> </li> <li > <a href="/docs/devcontainers/faq" >FAQ</a> </li> </ul> </li> </ul> </nav> <nav id="small-nav" aria-label="Topics" class="docs-nav hidden-md hidden-lg"> <label class="faux-h4" for="small-nav-dropdown">Topics</label> <select id="small-nav-dropdown" aria-label="topics"> <option value="/docs" >Overview</option> <optgroup label="Setup"> <option value="/docs/setup/setup-overview" >Overview</option> <option value="/docs/setup/linux" >Linux</option> <option value="/docs/setup/mac" >macOS</option> <option value="/docs/setup/windows" >Windows</option> <option value="/docs/setup/raspberry-pi" >Raspberry Pi</option> <option value="/docs/setup/network" >Network</option> <option value="/docs/setup/additional-components" >Additional Components</option> <option value="/docs/setup/enterprise" >Enterprise</option> <option value="/docs/setup/uninstall" >Uninstall</option> </optgroup> <optgroup label="Get Started"> <option value="/docs/getstarted/getting-started" >Tutorial</option> <option value="/docs/getstarted/introvideos" >Intro Videos</option> <option value="/docs/getstarted/tips-and-tricks" >Tips and Tricks</option> <option value="/docs/getstarted/userinterface" >User Interface</option> <option value="/docs/getstarted/themes" >Themes</option> <option value="/docs/getstarted/settings" >Settings</option> <option value="/docs/getstarted/keybindings" >Key Bindings</option> <option value="/docs/getstarted/locales" >Display Language</option> <option value="/docs/getstarted/telemetry" >Telemetry</option> <option value="/docs/getstarted/educators-and-students" >Educators & Students</option> </optgroup> <optgroup label="User Guide"> <option value="/docs/editor/codebasics" >Basic Editing</option> <option value="/docs/editor/extension-marketplace" >Extension Marketplace</option> <option value="/docs/editor/intellisense" >IntelliSense</option> <option value="/docs/editor/editingevolved" >Code Navigation</option> <option value="/docs/editor/refactoring" >Refactoring</option> <option value="/docs/editor/debugging" >Debugging</option> <option value="/docs/editor/testing" >Testing</option> <option value="/docs/editor/vscode-web" >VS Code for the Web</option> <option value="/docs/editor/tasks" >Tasks</option> <option value="/docs/editor/profiles" >Profiles</option> <option value="/docs/editor/settings-sync" >Settings Sync</option> <option value="/docs/editor/userdefinedsnippets" >Snippets</option> <option value="/docs/editor/emmet" >Emmet</option> <option value="/docs/editor/command-line" >Command Line Interface</option> <option value="/docs/editor/workspaces" >Workspaces</option> <option value="/docs/editor/workspace-trust" >Workspace Trust</option> <option value="/docs/editor/multi-root-workspaces" >Multi-root Workspaces</option> <option value="/docs/editor/accessibility" >Accessibility</option> <option value="/docs/editor/voice" >Voice Interactions</option> <option value="/docs/editor/custom-layout" >Custom Layout</option> <option value="/docs/editor/port-forwarding" >Port Forwarding</option> </optgroup> <optgroup label="Source Control"> <option value="/docs/sourcecontrol/overview" >Overview</option> <option value="/docs/sourcecontrol/intro-to-git" >Introduction to Git</option> <option value="/docs/sourcecontrol/github" >Collaborate on GitHub</option> <option value="/docs/sourcecontrol/faq" >FAQ</option> </optgroup> <optgroup label="Terminal"> <option value="/docs/terminal/getting-started" >Getting Started Tutorial</option> <option value="/docs/terminal/basics" >Terminal Basics</option> <option value="/docs/terminal/profiles" >Terminal Profiles</option> <option value="/docs/terminal/shell-integration" >Shell Integration</option> <option value="/docs/terminal/appearance" >Appearance</option> <option value="/docs/terminal/advanced" >Advanced</option> </optgroup> <optgroup label="GitHub Copilot"> <option value="/docs/copilot/overview" >Overview</option> <option value="/docs/copilot/copilot-vscode-features" >Copilot Cheat Sheet</option> <option value="/docs/copilot/setup" >Setup</option> <option value="/docs/copilot/getting-started" >Quickstart</option> <option value="/docs/copilot/ai-powered-suggestions" >Code Completions</option> <option value="/docs/copilot/copilot-chat" >Copilot Chat</option> <option value="/docs/copilot/getting-started-chat" >Copilot Chat Tutorial</option> <option value="/docs/copilot/copilot-edits" >Copilot Edits</option> <option value="/docs/copilot/prompt-crafting" >Best Practices</option> <option value="/docs/copilot/workspace-context" >Workspace Context</option> <option value="/docs/copilot/copilot-customization" >Customizing Copilot</option> <option value="/docs/copilot/copilot-extensibility-overview" >Copilot Extensibility</option> <option value="/docs/copilot/copilot-settings" >Settings Reference</option> <option value="/docs/copilot/faq" >FAQ</option> </optgroup> <optgroup label="Languages"> <option value="/docs/languages/overview" >Overview</option> <option value="/docs/languages/javascript" >JavaScript</option> <option value="/docs/languages/json" >JSON</option> <option value="/docs/languages/html" >HTML</option> <option value="/docs/languages/css" >CSS, SCSS and Less</option> <option value="/docs/languages/typescript" >TypeScript</option> <option value="/docs/languages/markdown" >Markdown</option> <option value="/docs/languages/powershell" >PowerShell</option> <option value="/docs/languages/cpp" >C++</option> <option value="/docs/languages/java" >Java</option> <option value="/docs/languages/php" >PHP</option> <option value="/docs/languages/python" >Python</option> <option value="/docs/languages/julia" >Julia</option> <option value="/docs/languages/r" >R</option> <option value="/docs/languages/ruby" >Ruby</option> <option value="/docs/languages/rust" >Rust</option> <option value="/docs/languages/go" >Go</option> <option value="/docs/languages/tsql" >T-SQL</option> <option value="/docs/languages/csharp" >C#</option> <option value="/docs/languages/dotnet" >.NET</option> <option value="/docs/languages/polyglot" >Polyglot</option> </optgroup> <optgroup label="Node.js / JavaScript"> <option value="/docs/nodejs/working-with-javascript" >Working with JavaScript</option> <option value="/docs/nodejs/nodejs-tutorial" >Node.js Tutorial</option> <option value="/docs/nodejs/nodejs-debugging" >Node.js Debugging</option> <option value="/docs/nodejs/nodejs-deployment" >Deploy Node.js Apps</option> <option value="/docs/nodejs/browser-debugging" >Browser Debugging</option> <option value="/docs/nodejs/angular-tutorial" >Angular Tutorial</option> <option value="/docs/nodejs/reactjs-tutorial" >React Tutorial</option> <option value="/docs/nodejs/vuejs-tutorial" >Vue Tutorial</option> <option value="/docs/nodejs/debugging-recipes" >Debugging Recipes</option> <option value="/docs/nodejs/profiling" >Performance Profiling</option> <option value="/docs/nodejs/extensions" >Extensions</option> </optgroup> <optgroup label="TypeScript"> <option value="/docs/typescript/typescript-tutorial" >Tutorial</option> <option value="/docs/typescript/typescript-compiling" >Compiling</option> <option value="/docs/typescript/typescript-editing" >Editing</option> <option value="/docs/typescript/typescript-refactoring" >Refactoring</option> <option value="/docs/typescript/typescript-debugging" >Debugging</option> </optgroup> <optgroup label="Python"> <option value="/docs/python/python-quick-start" >Quick Start</option> <option value="/docs/python/python-tutorial" >Tutorial</option> <option value="/docs/python/run" >Run Python Code</option> <option value="/docs/python/editing" >Editing Code</option> <option value="/docs/python/linting" >Linting</option> <option value="/docs/python/formatting" >Formatting</option> <option value="/docs/python/debugging" >Debugging</option> <option value="/docs/python/environments" >Environments</option> <option value="/docs/python/testing" >Testing</option> <option value="/docs/python/jupyter-support-py" >Python Interactive</option> <option value="/docs/python/tutorial-django" >Django Tutorial</option> <option value="/docs/python/tutorial-fastapi" >FastAPI Tutorial</option> <option value="/docs/python/tutorial-flask" >Flask Tutorial</option> <option value="/docs/python/tutorial-create-containers" >Create containers</option> <option value="/docs/python/python-on-azure" >Deploy Python Apps</option> <option value="/docs/python/python-web" >Python in the Web</option> <option value="/docs/python/settings-reference" selected>Settings Reference</option> </optgroup> <optgroup label="Java"> <option value="/docs/java/java-tutorial" >Getting Started</option> <option value="/docs/java/java-editing" >Navigate and Edit</option> <option value="/docs/java/java-refactoring" >Refactoring</option> <option value="/docs/java/java-linting" >Formatting and Linting</option> <option value="/docs/java/java-project" >Project Management</option> <option value="/docs/java/java-build" >Build Tools</option> <option value="/docs/java/java-debugging" >Run and Debug</option> <option value="/docs/java/java-testing" >Testing</option> <option value="/docs/java/java-spring-boot" >Spring Boot</option> <option value="/docs/java/java-tomcat-jetty" >Application Servers</option> <option value="/docs/java/java-on-azure" >Deploy Java Apps</option> <option value="/docs/java/java-gui" >GUI Applications</option> <option value="/docs/java/extensions" >Extensions</option> <option value="/docs/java/java-faq" >FAQ</option> </optgroup> <optgroup label="C++"> <option value="/docs/cpp/introvideos-cpp" >Intro Videos</option> <option value="/docs/cpp/config-linux" >GCC on Linux</option> <option value="/docs/cpp/config-mingw" >GCC on Windows</option> <option value="/docs/cpp/config-wsl" >GCC on Windows Subsystem for Linux</option> <option value="/docs/cpp/config-clang-mac" >Clang on macOS</option> <option value="/docs/cpp/config-msvc" >Microsoft C++ on Windows</option> <option value="/docs/cpp/build-with-cmake" >Build with CMake</option> <option value="/docs/cpp/cmake-linux" >CMake Tools on Linux</option> <option value="/docs/cpp/cmake-quickstart" >CMake Quick Start</option> <option value="/docs/cpp/cpp-ide" >Editing and Navigating</option> <option value="/docs/cpp/cpp-debug" >Debugging</option> <option value="/docs/cpp/cpp-refactoring" >Refactoring</option> <option value="/docs/cpp/launch-json-reference" >Configure debugging</option> <option value="/docs/cpp/customize-default-settings-cpp" >Settings</option> <option value="/docs/cpp/configure-intellisense" >Configure IntelliSense</option> <option value="/docs/cpp/configure-intellisense-crosscompilation" >Configure IntelliSense for cross-compiling</option> <option value="/docs/cpp/faq-cpp" >FAQ</option> </optgroup> <optgroup label="C#"> <option value="/docs/csharp/introvideos-csharp" >Intro Videos</option> <option value="/docs/csharp/get-started" >Get Started</option> <option value="/docs/csharp/navigate-edit" >Navigate and Edit</option> <option value="/docs/csharp/intellicode" >IntelliCode</option> <option value="/docs/csharp/refactoring" >Refactoring</option> <option value="/docs/csharp/formatting-linting" >Formatting and Linting</option> <option value="/docs/csharp/project-management" >Project Management</option> <option value="/docs/csharp/build-tools" >Build Tools</option> <option value="/docs/csharp/package-management" >Package Management</option> <option value="/docs/csharp/debugging" >Run and Debug</option> <option value="/docs/csharp/testing" >Testing</option> <option value="/docs/csharp/cs-dev-kit-faq" >FAQ</option> </optgroup> <optgroup label="Docker"> <option value="/docs/containers/overview" >Overview</option> <option value="/docs/containers/quickstart-node" >Node.js</option> <option value="/docs/containers/quickstart-python" >Python</option> <option value="/docs/containers/quickstart-aspnet-core" >ASP.NET Core</option> <option value="/docs/containers/debug-common" >Debug</option> <option value="/docs/containers/docker-compose" >Docker Compose</option> <option value="/docs/containers/quickstart-container-registries" >Registries</option> <option value="/docs/containers/app-service" >Deploy to Azure</option> <option value="/docs/containers/choosing-dev-environment" >Choose a dev environment</option> <option value="/docs/containers/reference" >Customize</option> <option value="/docs/containers/bridge-to-kubernetes" >Develop with Kubernetes</option> <option value="/docs/containers/troubleshooting" >Tips and Tricks</option> </optgroup> <optgroup label="Data Science"> <option value="/docs/datascience/overview" >Overview</option> <option value="/docs/datascience/jupyter-notebooks" >Jupyter Notebooks</option> <option value="/docs/datascience/data-science-tutorial" >Data Science Tutorial</option> <option value="/docs/datascience/python-interactive" >Python Interactive</option> <option value="/docs/datascience/data-wrangler-quick-start" >Data Wrangler Quick Start</option> <option value="/docs/datascience/data-wrangler" >Data Wrangler</option> <option value="/docs/datascience/pytorch-support" >PyTorch Support</option> <option value="/docs/datascience/azure-machine-learning" >Azure Machine Learning</option> <option value="/docs/datascience/jupyter-kernel-management" >Manage Jupyter Kernels</option> <option value="/docs/datascience/notebooks-web" >Jupyter Notebooks on the web</option> </optgroup> <optgroup label="Azure"> <option value="/docs/azure/overview" >Overview</option> <option value="/docs/azure/gettingstarted" >Getting Started</option> <option value="/docs/azure/deployment" >Deployment</option> <option value="/docs/azure/docker" >Docker</option> <option value="/docs/azure/aksextensions" >Azure Kubernetes Service</option> <option value="/docs/azure/kubernetes" >Kubernetes</option> <option value="/docs/azure/mongodb" >MongoDB</option> <option value="/docs/azure/remote-debugging" >Remote Debugging for Node.js</option> </optgroup> <optgroup label="Remote"> <option value="/docs/remote/remote-overview" >Overview</option> <option value="/docs/remote/ssh" >SSH</option> <option value="/docs/remote/dev-containers" >Dev Containers</option> <option value="/docs/remote/wsl" >Windows Subsystem for Linux</option> <option value="/docs/remote/codespaces" >GitHub Codespaces</option> <option value="/docs/remote/vscode-server" >VS Code Server</option> <option value="/docs/remote/tunnels" >Tunnels</option> <option value="/docs/remote/ssh-tutorial" >SSH Tutorial</option> <option value="/docs/remote/wsl-tutorial" >WSL Tutorial</option> <option value="/docs/remote/troubleshooting" >Tips and Tricks</option> <option value="/docs/remote/faq" >FAQ</option> </optgroup> <optgroup label="Dev Containers"> <option value="/docs/devcontainers/containers" >Overview</option> <option value="/docs/devcontainers/tutorial" >Tutorial</option> <option value="/docs/devcontainers/attach-container" >Attach to Container</option> <option value="/docs/devcontainers/create-dev-container" >Create a Dev Container</option> <option value="/docs/devcontainers/containers-advanced" >Advanced Containers</option> <option value="/docs/devcontainers/devcontainerjson-reference" >devcontainer.json</option> <option value="/docs/devcontainers/devcontainer-cli" >Dev Container CLI</option> <option value="/docs/devcontainers/tips-and-tricks" >Tips and Tricks</option> <option value="/docs/devcontainers/faq" >FAQ</option> </optgroup> </select> </nav> </div> <!-- small right nav --> <div class="col-xs-12 visible-xs"> <nav aria-labelledby="small-right-nav-label" class="small-nav docs-nav updates-nav"> <label class="faux-h4" for="small-right-nav-dropdown" id="small-right-nav-label">In this article</label> <select id="small-right-nav-dropdown" class="small-nav-select" aria-label="Sections"> <option value="#_general-python-settings">General Python settings</option> <option value="#_code-analysis-settings">Code analysis settings</option> <option value="#_autocomplete-settings">AutoComplete settings</option> <option value="#_testing-settings">Testing settings</option> <option value="#_predefined-variables">Predefined variables</option> <option value="#_next-steps">Next steps</option> </select> </nav> </div> <!-- main content --> <main class="col-xs-12 col-sm-9 col-md-8 body"> <div class="edit-github pull-right"> <a href="https://vscode.dev/github/microsoft/vscode-docs/blob/main/docs/python/settings-reference.md" class="btn btn-default" title="Edit this document in vscode.dev"> <span class="glyphicon glyphicon-pencil"></span> <span class="hidden-xs">Edit</span> </a> </div> <h1>Python settings reference</h1> <p>The Python Extension for Visual Studio Code is highly configurable. This page describes the key settings you can work with.</p> <p>For general information about working with settings in VS Code, refer to <a href="/docs/getstarted/settings">User and workspace settings</a>, as well as the <a href="/docs/editor/variables-reference">Variables reference</a> for information about predefined variable support.</p> <h2 id="_general-python-settings" data-needslink="_general-python-settings">General Python settings</h2> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.)</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>condaPath</td> <td><code>&quot;conda&quot;</code></td> <td>Path to the <code>conda</code> executable.</td> </tr> <tr> <td>defaultInterpreterPath</td> <td><code>&quot;python&quot;</code></td> <td>Path to the default Python interpreter to be used by the Python extension on the first time it loads for a workspace, or the path to a folder containing the Python interpreter. <br> Can use variables like <code>${workspaceFolder}</code> and <code>${workspaceFolder}/.venv</code>. <br> Using a path to a folder allows anyone working with a project to create an environment in the <code>.venv</code> folder as appropriate to their operating system, rather than having to specify an exact platform-dependent path. The <code>settings.json</code> file can then be included in a source code repository. <br> <strong>Note</strong>: Changes to this setting made after an interpreter has been selected for a workspace will not be applied or considered by the Python extension. The Python extension doesn't automatically add or change this setting.</td> </tr> <tr> <td>interpreter.infoVisibility</td> <td><code>&quot;onPythonRelated&quot;</code></td> <td>Controls when to display the selected interpreter information on the status bar. <br> By default, it only shows when there are Python related files open in the editor. <br> You can set it to <code>&quot;always&quot;</code> if you'd like it to always show on the status bar, or <code>&quot;never&quot;</code> to hide it entirely.</td> </tr> <tr> <td>pipenvPath</td> <td><code>&quot;pipenv&quot;</code></td> <td>Path to the pipenv executable to use for activation.</td> </tr> <tr> <td>venvFolders</td> <td><code>[]</code></td> <td>Paths to folders where virtual environments are created. <br> Depending on the virtualization tool used, it can be the project itself: <code>${workspaceFolder}</code>, or separate folders for all virtual environments located side by side: <code>.\envs</code>, <code>~/.virtualenvs</code>, and so on.</td> </tr> <tr> <td>envFile</td> <td><code>&quot;${workspaceFolder}/</code><br/><code>.env&quot;</code></td> <td>Absolute path to a file containing environment variable definitions. <br> See <a href="/docs/python/environments#_environment-variable-definitions-file">Configuring Python environments - environment variable definitions file</a>.</td> </tr> <tr> <td>globalModuleInstallation</td> <td><code>false</code></td> <td>Specifies whether to install packages for the current user only using the <code>--user</code> command-line argument (the default), or to install for all users in the global environment (when set to <code>true</code>). Ignored when using a virtual environment. <br> For more information on the <code>--user</code> argument, see <a href="https://pip.pypa.io/en/stable/user_guide/#user-installs" class="external-link" target="_blank">pip - User Installs</a>.</td> </tr> <tr> <td>poetryPath</td> <td><code>&quot;poetry&quot;</code></td> <td>Specifies the location of the <a href="https://poetry.eustace.io/" class="external-link" target="_blank">Poetry dependency manager</a> executable, if installed. The default value <code>&quot;poetry&quot;</code> assumes the executable is in the current path. <br> The Python extension uses this setting to install packages when Poetry is available and there's a <code>poetry.lock</code> file in the workspace folder.</td> </tr> <tr> <td>terminal.launchArgs</td> <td><code>[]</code></td> <td>Launch arguments that are given to the Python interpreter when you run a file using commands such as <strong>Python: Run Python File in Terminal</strong>.<br> In the <code>launchArgs</code> list, each item is a top-level command-line element that's separated by a space (quoted values that contain spaces are a single top-level element and are thus one item in the list). <br> For example, for the arguments <code>--a --b --c {&quot;value1&quot; : 1, &quot;value2&quot; : 2}</code>, the list items should be <code>[&quot;--a&quot;, &quot;--b&quot;, &quot;--c&quot;, &quot;{\&quot;value1\&quot; : 1, \&quot;value2\&quot; : 2}\&quot;&quot;]</code>. <br> Note that VS Code ignores this setting when debugging because it instead uses arguments from your selected debugging configuration in <code>launch.json</code>.</td> </tr> <tr> <td>terminal.executeInFileDir</td> <td><code>false</code></td> <td>Indicates whether to run a file in the file's directory instead of the current folder.</td> </tr> <tr> <td>terminal.activateEnvironment</td> <td><code>true</code></td> <td>Indicates whether to automatically activate the environment you select using the <strong>Python: Select Interpreter</strong> command when a new terminal is created.<br> For example, when this setting is <code>true</code> and you select a virtual environment, the extension automatically runs the environment's <em>activate</em> command when creating a new terminal (<code>source env/bin/activate</code> on macOS/Linux; <code>env\scripts\activate</code> on Windows).</td> </tr> <tr> <td>terminal.activateEnvInCurrentTerminal</td> <td><code>false</code></td> <td>Specifies whether to activate the currently open terminal when the Python extension is activated, using the virtual environment selected.</td> </tr> <tr> <td>terminal.focusAfterLaunch</td> <td><code>false</code></td> <td>Whether to switch the cursor focus to the terminal when launching a Python terminal.</td> </tr> <tr> <td>logging.level</td> <td><code>error</code></td> <td>Specifies the level of logging to be performed by the extension.<br> The possible levels of logging, in increasing level of information provided, are <code>off</code>, <code>error</code>, <code>warn</code>, <code>info</code>, and <code>debug</code>.<br> When set to <code>off</code>, which is not recommended, basic information will still be shown such as startup information and commands run by the Python extension.<br> At the <code>error</code> level, basic information and errors will be shown.<br> At the <code>warn</code> level, basic, error, and warning information will be shown. At the <code>info</code> level, basic, error, warning, and additional information like method execution times and return values will be shown. At this time, the <code>debug</code> level doesn't display additional information.</td> </tr> <tr> <td>experiments.enabled</td> <td><code>true</code></td> <td>Enables <a href="https://aka.ms/AAjvt9q" class="external-link" target="_blank">A/B experiments in the Python extension</a>. If enabled, you may be provided with proposed enhancements and/or features.</td> </tr> </tbody> </table> <h2 id="_code-analysis-settings" data-needslink="_code-analysis-settings">Code analysis settings</h2> <h3 id="_intellisense-engine-settings" data-needslink="_intellisense-engine-settings">IntelliSense engine settings</h3> <blockquote><p><strong>Note:</strong> If you have never changed your language server setting, your language server is set to Pylance via the “Default” setting value.</p> </blockquote><table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.)</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>languageServer</td> <td>Default</td> <td>Defines type of the language server (Default, <a href="https://devblogs.microsoft.com/python/announcing-pylance-fast-feature-rich-language-support-for-python-in-visual-studio-code/" class="external-link" target="_blank">Pylance</a>, Jedi, and None).</td> </tr> </tbody> </table> <h3 id="_python-language-server-settings" data-needslink="_python-language-server-settings">Python Language Server settings</h3> <h4 id="_pylance-language-server" data-needslink="_pylance-language-server">Pylance Language Server</h4> <p>The language server settings apply when <code>python.languageServer</code> is <code>Pylance</code> or <code>Default</code>. If you have difficulties with the language server, see <a href="https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md" class="external-link" target="_blank">Troubleshooting</a> in the language server repository.</p> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.analysis.)</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>typeCheckingMode</td> <td>off</td> <td>Specifies the level of type checking analysis to perform. <br> Available values are <code>off</code>, <code>basic</code>, and <code>strict</code>. <br> When set to <code>off</code> no type checking analysis is conducted; unresolved imports/variables diagnostics are produced. <br> When set to <code>basic</code> non-type checking-related rules (all rules in <code>off</code>), as well as basic type checking rules are used. <br> When set to <code>strict</code> all type checking rules at the highest severity of error (including all rules in <code>off</code> and <code>basic</code> categories) are used.</td> </tr> <tr> <td>languageServerMode</td> <td>default</td> <td>Offers predefined configurations to optimize Pylance's performance based on the development needs. <br> Available values are <code>default</code> and <code>light</code>. <br> When set to <code>default</code>, the language server delivers sufficient functionality for most machines without overloading the system. <br> When set to <code>light</code>, it enables a lightweight, memory-efficient setup. This mode disables various features to make Pylance function more like a streamlined text editor, and it's ideal for those who do not require the full breadth of IntelliSense capabilities and prefer Pylance to be as resource-friendly as possible. <br> Default setting values are overriden to the following by each mode: <table> <tr> <th>Setting</th> <th><code>light</code> mode</th> <th> <code>default</code> mode </th> </tr> <tr> <td>python.analysis.exclude</td> <td> [&quot;**&quot;] </td> <td> [] </td> <tr> <td>python.analysis.useLibraryCodeForTypes</td> <td>false</td> <td>true</td> <tr> <td> python.analysis.enablePytestSupport </td> <td>false</td> <td>true </td> <tr> <td> python.analysis.indexing </td> <td>false</td> <td>true </td></tr> </table></td> </tr> <tr> <td>diagnosticMode</td> <td>openFilesOnly</td> <td>Specifies what code files the language server analyzes for problems. <br> Available values are <code>workspace</code> and <code>openFilesOnly</code>.</td> </tr> <tr> <td>include</td> <td>[]</td> <td>Paths of directories or files that should be included in analysis. <br> If no paths are specified, Pylance defaults to the directory that contains the workspace root. <br> Paths may contain wildcard characters such as <code>**</code> (a directory or multiple levels of directories), <code>*</code> (a sequence of zero or more characters), or <code>?</code> (a single character).</td> </tr> <tr> <td>exclude</td> <td>[]</td> <td>Paths of directories or files that should not be included in analysis. <br> These override the directories listed under the <code>python.analysis.include</code> setting, allowing specific subdirectories to be excluded. <br> Note that files listed in this <code>exclude</code> setting may still be included in the analysis if they are referenced/imported by source files that are not in the excluded list. <br> Paths may contain wildcard characters such as <code>**</code> (a directory or multiple levels of directories), <code>*</code> (a sequence of zero or more characters), or <code>?</code> (a single character). <br> If no exclude paths are specified, Pylance automatically excludes the following: <code>**/node_modules</code>, <code>**/\_\_pycache\_\_</code>, <code>.git</code> and any virtual environment directories.</td> </tr> <tr> <td>ignore</td> <td>[]</td> <td>Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed, even if they are an included file or within the transitive closure of an included file. <br> Paths may contain wildcard characters such as <code>**</code> (a directory or multiple levels of directories), <code>*</code> (a sequence of zero or more characters), or <code>?</code> (a single character). <br> If no value is provided, the value of <code>python.linting.ignorePatterns</code> (if set) will be used.</td> </tr> <tr> <td>stubPath</td> <td>./typings</td> <td>Specifies a path to a directory that contains custom type stubs. Each package's type stub file(s) are expected to be in its own subdirectory.</td> </tr> <tr> <td>autoSearchPaths</td> <td>true</td> <td>Indicates whether to automatically add search paths based on some predefined names (like <code>src</code>). Available values are <code>true</code> and <code>false</code>.</td> </tr> <tr> <td>extraPaths</td> <td>[]</td> <td>Specifies extra search paths for import resolution. <br> Accepts paths specified as strings and separated by commas if there are multiple paths. For example: <code>[&quot;path 1&quot;,&quot;path 2&quot;]</code>.</td> </tr> <tr> <td>indexing</td> <td>true</td> <td>Used to specify whether Pylance should index user files as well as installed third party libraries at start up, to provide a more complete set of symbols in features such as auto imports, Quick Fixes, auto completions, etc. <br> Accepted values are <code>true</code> or <code>false</code>. <br> When set to <code>true</code>, by default Pylance indexes top-level symbols of installed packages (i.e., symbols in <code>__all__</code> under <code>package/__init__.py</code>), as well as all symbols from up to 2000 user files. <br> When set to <code>false</code>, Pylance will only display symbols already referenced or used in files that were previously opened in or loaded by the editor.</td> </tr> <tr> <td>packageIndexDepths</td> <td>[]</td> <td>Used to override how many levels under installed packages to index on a per package basis. <br> By default, only top-level modules are indexed (depth = 1). <br> To index submodules, increase depth by 1 for each level of submodule you want to index. <br> Accepted values are tuples of objects like <code>{&quot;name&quot;: &quot;package name (str)&quot;, &quot;depth&quot;: &quot;depth to scan (int)&quot;, &quot;includeAllSymbols&quot;: &quot;whether to include all symbols (bool)&quot;}</code>. <br> If <code>includeAllSymbols</code> is set to <code>false</code>, only symbols in each package's <code>__all__</code> are included. When it's set to <code>true</code>, Pylance will index every module/top level symbol declarations in the file. <br> Usage example: <code>[{&quot;name&quot;: &quot;sklearn&quot;, &quot;depth&quot;: 2, &quot;includeAllSymbols&quot;: true}, {&quot;name&quot;: &quot;matplotlib&quot;, &quot;depth&quot;: 3, &quot;includeAllSymbols&quot;: false}]</code></td> </tr> <tr> <td>userFileIndexingLimit</td> <td>2000</td> <td>Sets the maximum number of user files for Pylance to index in the workspace. When set to -1, Pylance will index all files. <br> Note that indexing files is a performance-intensive task.</td> </tr> <tr> <td>autoFormatStrings</td> <td>false</td> <td>When typing &quot;{&quot; inside a string, whether to automatically prefix it with an &quot;f&quot;.</td> </tr> <tr> <td>completeFunctionParens</td> <td>false</td> <td>Adds parentheses to function completions. Accepted values are <code>true</code> and <code>false</code>.</td> </tr> <tr> <td>useLibraryCodeForTypes</td> <td>true</td> <td>Parses the source code for a package when a type stub is not found. Available values are <code>true</code> and <code>false</code>.</td> </tr> <tr> <td>includeAliasesFromUserFiles</td> <td>false</td> <td>Whether to include alias symbols from user files in auto-import suggestions and in the add import Quick Fix. When disabled, Pylance will offer the import suggestion from where the symbol is defined. When enabled, it'll also offer import suggestions from files where the symbol is imported (i.e. aliased). Available values are <code>true</code> and <code>false</code>.</td> </tr> <tr> <td>autoImportCompletions</td> <td>false</td> <td>Controls the offering of auto imports in completions. Available values are <code>true</code> and <code>false</code>.</td> </tr> <tr> <td>importFormat</td> <td>absolute</td> <td>Defines the default format when auto importing modules. Accepted values are <code>absolute</code> or <code>relative</code>.</td> </tr> <tr> <td>aiCodeActions</td> <td>true</td> <td>Whether to enable specific AI-assisted code actions. Requires the <a href="https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat" class="external-link" target="_blank">GitHub Copilot Chat</a> extension to be enabled. <br> Accepted value is an object with a code action as key and a boolean as value. <br> Available code actions to use as keys: <ul> <li> <code>implementAbstractClasses</code>: enables code action to implement methods of classes inherited from an abstract class, using AI suggestions from GitHub Copilot to populate the method body. </li> </ul> Usage example: <code>{&quot;implementAbstractClasses&quot;: true}</code></td> </tr> <tr> <td>inlayHints.variableTypes</td> <td>false</td> <td>Whether to display inlay hints for variable types. Accepted values are <code>true</code> or <code>false</code>.</td> </tr> <tr> <td>inlayHints.functionReturnTypes</td> <td>false</td> <td>Whether to display inlay hints for function return types. Accepted values are <code>true</code> or <code>false</code>.</td> </tr> <tr> <td>inlayHints.callArgumentNames</td> <td>false</td> <td>Whether to display inlay hints for call argument names. Accepted values are <code>true</code> or <code>false</code>.</td> </tr> <tr> <td>inlayHints.pytestParameters</td> <td>false</td> <td>Whether to display inlay hints for pytest fixture argument types. Accepted values are <code>true</code> or <code>false</code>.</td> </tr> <tr> <td>diagnosticSeverityOverrides</td> <td>{}</td> <td>Allows a user to override the severity levels for individual diagnostics. <br> For each rule, the available severity levels are <code>error</code> (red squiggle), <code>warning</code> (yellow squiggle), <code>information</code> (blue squiggle), and <code>none</code> (rule disabled). <br> For information about the keys to use for the diagnostic severity rules, see the <strong>Diagnostic severity rules</strong> section below.</td> </tr> <tr> <td>fixAll</td> <td><code>[]</code></td> <td>A list of code actions to run when running the <strong>Fix All</strong> command or the <code>source.fixAll</code> code action. <br> Accepted values in this list: <ul><li> <code>source.unusedImports</code>: removes all unused imports in the open file</li> <li> <code>source.convertImportFormat</code>: converts the imports according to the <code>python.analysis.importFormat</code> setting </li></td> </tr> <tr> <td>logLevel</td> <td><code>Error</code></td> <td>Specifies the level of logging to be performed by the language server.<br> The possible levels of logging, in increasing level of information provided, are <code>Error</code>, <code>Warning</code>, <code>Information</code>, and <code>Trace</code>.</td> </tr> <tr> <td>autoIndent</td> <td>true</td> <td>Whether to automatically adjust indentation based on language semantics when typing Python code. <br> Accepted values are <code>true</code> or <code>false</code>.</td> </tr> </tbody> </table> <p><strong>Diagnostic severity rules</strong></p> <p>This section details all the available rules that can be customized using the <code>python.analysis.diagnosticSeverityOverrides</code> setting as shown in the following example.</p> <pre class="shiki" style="background-color: #1e1e1e"><code><span class="line"><span style="color: #BBBBBB">{</span></span> <span class="line"><span style="color: #BBBBBB"> </span><span style="color: #9CDCFE">&quot;python.analysis.diagnosticSeverityOverrides&quot;</span><span style="color: #BBBBBB">: {</span></span> <span class="line"><span style="color: #BBBBBB"> </span><span style="color: #9CDCFE">&quot;reportUnboundVariable&quot;</span><span style="color: #BBBBBB">: </span><span style="color: #CE9178">&quot;information&quot;</span><span style="color: #BBBBBB">,</span></span> <span class="line"><span style="color: #BBBBBB"> </span><span style="color: #9CDCFE">&quot;reportImplicitStringConcatenation&quot;</span><span style="color: #BBBBBB">: </span><span style="color: #CE9178">&quot;warning&quot;</span></span> <span class="line"><span style="color: #BBBBBB"> }</span></span> <span class="line"><span style="color: #BBBBBB">}</span></span> <span class="line"></span></code></pre> <table class="table table-striped"> <thead> <tr> <th>Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>reportGeneralTypeIssues</td> <td>Diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors.</td> </tr> <tr> <td>reportPropertyTypeMismatch</td> <td>Diagnostics for properties where the type of the value passed to the setter is not assignable to the value returned by the getter. Such mismatches violate the intended use of properties, which are meant to act like variables.</td> </tr> <tr> <td>reportFunctionMemberAccess</td> <td>Diagnostics for member accesses on functions.</td> </tr> <tr> <td>reportMissingImports</td> <td>Diagnostics for imports that have no corresponding imported python file or type stub file.</td> </tr> <tr> <td>reportMissingModuleSource</td> <td>Diagnostics for imports that have no corresponding source file. This happens when a type stub is found, but the module source file was not found, indicating that the code may fail at runtime when using this execution environment. Type checking will be done using the type stub.</td> </tr> <tr> <td>reportMissingTypeStubs</td> <td>Diagnostics for imports that have no corresponding type stub file (either a typeshed file or a custom type stub). The type checker requires type stubs to do its best job at analysis.</td> </tr> <tr> <td>reportImportCycles</td> <td>Diagnostics for cyclical import chains. These are not errors in Python, but they do slow down type analysis and often hint at architectural layering issues. Generally, they should be avoided.</td> </tr> <tr> <td>reportUnusedImport</td> <td>Diagnostics for an imported symbol that is not referenced within that file.</td> </tr> <tr> <td>reportUnusedClass</td> <td>Diagnostics for a class with a private name (starting with an underscore) that is not accessed.</td> </tr> <tr> <td>reportUnusedFunction</td> <td>Diagnostics for a function or method with a private name (starting with an underscore) that is not accessed.</td> </tr> <tr> <td>reportUnusedVariable</td> <td>Diagnostics for a variable that is not accessed.</td> </tr> <tr> <td>reportDuplicateImport</td> <td>Diagnostics for an imported symbol or module that is imported more than once.</td> </tr> <tr> <td>reportWildcardImportFromLibrary</td> <td>Diagnostics for a wildcard import from an external library.</td> </tr> <tr> <td>reportOptionalSubscript</td> <td>Diagnostics for an attempt to subscript (index) a variable with an Optional type.</td> </tr> <tr> <td>reportOptionalMemberAccess</td> <td>Diagnostics for an attempt to access a member of a variable with an Optional type.</td> </tr> <tr> <td>reportOptionalCall</td> <td>Diagnostics for an attempt to call a variable with an Optional type.</td> </tr> <tr> <td>reportOptionalIterable</td> <td>Diagnostics for an attempt to use an Optional type as an iterable value (e.g. within a for statement).</td> </tr> <tr> <td>reportOptionalContextManager</td> <td>Diagnostics for an attempt to use an Optional type as a context manager (as a parameter to a with statement).</td> </tr> <tr> <td>reportOptionalOperand</td> <td>Diagnostics for an attempt to use an Optional type as an operand to a binary or unary operator (like '+', '==', 'or', 'not').</td> </tr> <tr> <td>reportUntypedFunctionDecorator</td> <td>Diagnostics for function decorators that have no type annotations. These obscure the function type, defeating many type analysis features.</td> </tr> <tr> <td>reportUntypedClassDecorator</td> <td>Diagnostics for class decorators that have no type annotations. These obscure the class type, defeating many type analysis features.</td> </tr> <tr> <td>reportUntypedBaseClass</td> <td>Diagnostics for base classes whose type cannot be determined statically. These obscure the class type, defeating many type analysis features.</td> </tr> <tr> <td>reportUntypedNamedTuple</td> <td>Diagnostics when “namedtuple” is used rather than “NamedTuple”. The former contains no type information, whereas the latter does.</td> </tr> <tr> <td>reportPrivateUsage</td> <td>Diagnostics for incorrect usage of private or protected variables or functions. Protected class members begin with a single underscore <code>_</code> and can be accessed only by subclasses. Private class members begin with a double underscore but do not end in a double underscore and can be accessed only within the declaring class. Variables and functions declared outside of a class are considered private if their names start with either a single or double underscore, and they cannot be accessed outside of the declaring module.</td> </tr> <tr> <td>reportConstantRedefinition</td> <td>Diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals.</td> </tr> <tr> <td>reportIncompatibleMethodOverride</td> <td>Diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type).</td> </tr> <tr> <td>reportIncompatibleVariableOverride</td> <td>Diagnostics for class variable declarations that override a symbol of the same name in a base class with a type that is incompatible with the base class symbol type.</td> </tr> <tr> <td>reportInvalidStringEscapeSequence</td> <td>Diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions.</td> </tr> <tr> <td>reportUnknownParameterType</td> <td>Diagnostics for input or return parameters for functions or methods that have an unknown type.</td> </tr> <tr> <td>reportUnknownArgumentType</td> <td>Diagnostics for call arguments for functions or methods that have an unknown type.</td> </tr> <tr> <td>reportUnknownLambdaType</td> <td>Diagnostics for input or return parameters for lambdas that have an unknown type.</td> </tr> <tr> <td>reportUnknownVariableType</td> <td>Diagnostics for variables that have an unknown type.</td> </tr> <tr> <td>reportUnknownMemberType</td> <td>Diagnostics for class or instance variables that have an unknown type.</td> </tr> <tr> <td>reportMissingTypeArgument</td> <td>Diagnostics for when a generic class is used without providing explicit or implicit type arguments.</td> </tr> <tr> <td>reportInvalidTypeVarUse</td> <td>Diagnostics for improper use of type variables in a function signature.</td> </tr> <tr> <td>reportCallInDefaultInitializer</td> <td>Diagnostics for function calls within a default value initialization expression. Such calls can mask expensive operations that are performed at module initialization time.</td> </tr> <tr> <td>reportUnnecessaryIsInstance</td> <td>Diagnostics for 'isinstance' or 'issubclass' calls where the result is statically determined to be always true or always false. Such calls are often indicative of a programming error.</td> </tr> <tr> <td>reportUnnecessaryCast</td> <td>Diagnostics for 'cast' calls that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error.</td> </tr> <tr> <td>reportAssertAlwaysTrue</td> <td>Diagnostics for 'assert' statement that will probably always assert. This can be indicative of a programming error.</td> </tr> <tr> <td>reportSelfClsParameterName</td> <td>Diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods.</td> </tr> <tr> <td>reportImplicitStringConcatenation</td> <td>Diagnostics for two or more string literals that follow each other, indicating an implicit concatenation. This is considered a bad practice and often masks bugs such as missing commas.</td> </tr> <tr> <td>reportUndefinedVariable</td> <td>Diagnostics for undefined variables.</td> </tr> <tr> <td>reportUnboundVariable</td> <td>Diagnostics for unbound and possibly unbound variables.</td> </tr> <tr> <td>reportInvalidStubStatement</td> <td>Diagnostics for statements that should not appear within a stub file.</td> </tr> <tr> <td>reportUnusedCallResult</td> <td>Diagnostics for call expressions whose results are not consumed and are not None.</td> </tr> <tr> <td>reportUnsupportedDunderAll</td> <td>Diagnostics for unsupported operations performed on <code>__all__</code>.</td> </tr> <tr> <td>reportUnusedCoroutine</td> <td>Diagnostics for call expressions that return a Coroutine and whose results are not consumed.</td> </tr> </tbody> </table> <h2 id="_autocomplete-settings" data-needslink="_autocomplete-settings">AutoComplete settings</h2> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.autoComplete.)</th> <th>Default</th> <th>Description</th> <th>See also</th> </tr> </thead> <tbody> <tr> <td>extraPaths</td> <td><code>[]</code></td> <td>Specifies locations of additional packages for which to load autocomplete data.</td> <td><a href="/docs/python/editing#_autocomplete-and-intellisense">Editing</a></td> </tr> </tbody> </table> <h2 id="_testing-settings" data-needslink="_testing-settings">Testing settings</h2> <h3 id="_general-testing" data-needslink="_general-testing">General testing</h3> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.testing.)</th> <th>Default</th> <th>Description</th> <th>See also</th> </tr> </thead> <tbody> <tr> <td>cwd</td> <td>null</td> <td>Specifies an optional working directory for tests.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>promptToConfigure</td> <td><code>true</code></td> <td>Specifies whether VS Code prompts to configure a test framework if potential tests are discovered.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>debugPort</td> <td><code>3000</code></td> <td>Port number used for debugging of unittest tests.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>autoTestDiscoverOnSaveEnabled</td> <td><code>true</code></td> <td>Specifies whether to enable or disable auto run test discovery when saving a test file.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> </tbody> </table> <h3 id="_unittest-framework" data-needslink="_unittest-framework">unittest framework</h3> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.testing.)</th> <th>Default</th> <th>Description</th> <th>See also</th> </tr> </thead> <tbody> <tr> <td>unittestEnabled</td> <td><code>false</code></td> <td>Specifies whether unittest is enabled for testing.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>unittestArgs</td> <td><code>[&quot;-v&quot;, &quot;-s&quot;, &quot;.&quot;, &quot;-p&quot;, &quot;*test*.py&quot;]</code></td> <td>Arguments to pass to unittest, where each top-level element that's separated by a space is a separate item in the list.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> </tbody> </table> <h3 id="_pytest-framework" data-needslink="_pytest-framework">pytest framework</h3> <table class="table table-striped"> <thead> <tr> <th>Setting<br/>(python.testing.)</th> <th>Default</th> <th>Description</th> <th>See also</th> </tr> </thead> <tbody> <tr> <td>pytestEnabled</td> <td><code>false</code></td> <td>Specifies whether pytest is enabled for testing.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>pytestPath</td> <td><code>&quot;pytest&quot;</code></td> <td>Path to pytest. Use a full path if pytest is located outside the current environment.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> <tr> <td>pytestArgs</td> <td><code>[]</code></td> <td>Arguments to pass to pytest, where each top-level element that's separated by a space is a separate item in the list. When debugging tests with pytest-cov installed, include <code>--no-cov</code> in these arguments.</td> <td><a href="/docs/python/testing">Testing</a></td> </tr> </tbody> </table> <h2 id="_predefined-variables" data-needslink="_predefined-variables">Predefined variables</h2> <p>The Python extension settings support predefined variables. Similar to the general VS Code settings, variables use the <strong>${variableName}</strong> syntax. Specifically, the extension supports the following variables:</p> <ul> <li> <p><strong>${cwd}</strong> - the task runner's current working directory on startup</p> </li> <li> <p><strong>${workspaceFolder}</strong> - the path of the folder opened in VS Code</p> </li> <li> <p><strong>${workspaceRootFolderName}</strong> - the name of the folder opened in VS Code without any slashes (/)</p> </li> <li> <p><strong>${workspaceFolderBasename}</strong> - the name of the folder opened in VS Code without any slashes (/)</p> </li> <li> <p><strong>${file}</strong> - the current opened file</p> </li> <li> <p><strong>${relativeFile}</strong> - the current opened file relative to <code>workspaceFolder</code></p> </li> <li> <p><strong>${relativeFileDirname}</strong> - the current opened file's dirname relative to <code>workspaceFolder</code></p> </li> <li> <p><strong>${fileBasename}</strong> - the current opened file's basename</p> </li> <li> <p><strong>${fileBasenameNoExtension}</strong> - the current opened file's basename with no file extension</p> </li> <li> <p><strong>${fileDirname}</strong> - the current opened file's dirname</p> </li> <li> <p><strong>${fileExtname}</strong> - the current opened file's extension</p> </li> <li> <p><strong>${lineNumber}</strong> - the current selected line number in the active file</p> </li> <li> <p><strong>${selectedText}</strong> - the current selected text in the active file</p> </li> <li> <p><strong>${execPath}</strong> - the path to the running VS Code executable</p> </li> </ul> <p>For additional information about predefined variables and example usages, see the <a href="/docs/editor/variables-reference">Variables reference</a> in the general VS Code docs.</p> <h2 id="_next-steps" data-needslink="_next-steps">Next steps</h2> <ul> <li><a href="/docs/python/environments">Python environments</a> - Control which Python interpreter is used for editing and debugging.</li> <li><a href="/docs/python/editing">Editing code</a> - Learn about autocomplete, IntelliSense, formatting, and refactoring for Python.</li> <li><a href="/docs/python/linting">Linting</a> - Enable, configure, and apply a variety of Python linters.</li> <li><a href="/docs/python/debugging">Debugging</a> - Learn to debug Python both locally and remotely.</li> <li><a href="/docs/python/testing">Testing</a> - Configure test environments and discover, run, and debug tests.</li> </ul> <div class="feedback"></div> <div class="body-footer">3/6/2023</div> </main> <!-- medium right nav --> <div class="col-sm-3 col-md-2 hidden-xs docs-subnavbar-container"> <nav id="docs-subnavbar" aria-label="On Page" data-spy="affix" data-offset-top="20"> <h4><span class="sr-only">In this article there are 6 sections</span><span aria-hidden="true">In this article</span></h4> <ul class="nav"> <li><a href="#_general-python-settings">General Python settings</a></li> <li><a href="#_code-analysis-settings">Code analysis settings</a></li> <li><a href="#_autocomplete-settings">AutoComplete settings</a></li> <li><a href="#_testing-settings">Testing settings</a></li> <li><a href="#_predefined-variables">Predefined variables</a></li> <li><a href="#_next-steps">Next steps</a></li> </ul> <div class="connect-widget"></div> </nav> </div> <!-- end of page connect widget --> <div class="col-xs-12 visible-xs"> <div class="connect-widget"></div> </div> </div> </div> </div> </div> <footer role="contentinfo" class="container"> <div class="footer-container"> <div class="footer-row"> <div class="footer-social"> <ul class="links"> <li> <a href="https://go.microsoft.com/fwlink/?LinkID=533687"><img src="/assets/icons/x-icon.svg" class="x-icon" alt="Follow us on X"></a> </li> <li> <a href="https://github.com/microsoft/vscode"><img src="/assets/icons/github-icon.svg" alt="VS Code on Github"></a> </li> <li> <a href="https://www.youtube.com/@code"><img src="/assets/icons/youtube-icon.svg" alt="VS Code on YouTube"></a> </li> <script> function manageConsent() { if (siteConsent && siteConsent.isConsentRequired) { siteConsent.manageConsent(); } } </script> </ul> <a id="footer-microsoft-link" class="microsoft-logo" href="https://www.microsoft.com"> <img src="/assets/icons/microsoft.svg" alt="Microsoft homepage" /> </a> </div> </div> <div class="footer-row"> <ul class="links"> <li><a id="footer-support-link" href="https://support.serviceshub.microsoft.com/supportforbusiness/create?sapId=d66407ed-3967-b000-4cfb-2c318cad363d" target="_blank" rel="noopener">Support</a></li> <li><a id="footer-privacy-link" href="https://go.microsoft.com/fwlink/?LinkId=521839" target="_blank" rel="noopener">Privacy</a></li> <li style="display: none;"><a id="footer-cookie-link" style="cursor: pointer;" onclick="manageConsent()" target="_blank" rel="noopener">Manage Cookies</a></li> <li><a id="footer-terms-link" href="https://www.microsoft.com/legal/terms-of-use" target="_blank" rel="noopener">Terms of Use</a></li> <li><a id="footer-license-link" href="/License" target="_blank" rel="noopener">License</a></li> </ul> </div> </div> </footer> <script src="/dist/index.js"></script> <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "SoftwareApplication", "name" : "Visual Studio Code", "softwareVersion": "1.95", "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }, "applicationCategory": "DeveloperApplication", "applicationSubCategory": "Text Editor", "alternateName": "VS Code", "datePublished": "2021-11-03", "operatingSystem": "Mac, Linux, Windows", "logo": "https://code.visualstudio.com/assets/apple-touch-icon.png", "screenshot": "https://code.visualstudio.com/assets/home/home-screenshot-win.png", "releaseNotes": "https://code.visualstudio.com/updates", "downloadUrl": "https://code.visualstudio.com/download", "license": "https://code.visualstudio.com/license", "softwareRequirements": "https://code.visualstudio.com/docs/supporting/requirements", "url" : "https://code.visualstudio.com", "author": { "@type": "Organization", "name": "Microsoft" }, "publisher": { "@type": "Organization", "name": "Microsoft" }, "maintainer": { "@type": "Organization", "name": "Microsoft" }, "potentialAction": { "@type": "SearchAction", "target": "https://code.visualstudio.com/Search?q={search_term_string}", "query-input": "required name=search_term_string" }, "sameAs" : [ "https://en.wikipedia.org/wiki/Visual_Studio_Code", "https://twitter.com/code", "https://www.youtube.com/code", "https://www.tiktok.com/@vscode", "https://github.com/microsoft/vscode" ] } </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10