{"id":10054,"date":"2025-05-08T14:39:00","date_gmt":"2025-05-08T22:39:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=10054"},"modified":"2025-05-08T14:39:00","modified_gmt":"2025-05-08T22:39:00","slug":"python-in-visual-studio-code-may-2025-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-may-2025-release\/","title":{"rendered":"Python in Visual Studio Code &#8211; May 2025 Release"},"content":{"rendered":"<p>We&#8217;re excited to announce the May 2025 release of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python<\/a>, <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-pylance\">Pylance<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter<\/a> extensions for Visual Studio Code!<\/p>\n<p>This release includes the following announcements:<\/p>\n<ul>\n<li>Python Environments Quick Create command<\/li>\n<li>Python Environments chat tools<\/li>\n<li>Automatic environment activation with Python Environments (Experimental)<\/li>\n<li>Color picker with Pylance<\/li>\n<li>AI Code Actions: Convert Format String (Experimental)<\/li>\n<li>PyConUS 2025<\/li>\n<\/ul>\n<p>If you&#8217;re interested, you can check the full list of improvements in our changelogs for the <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/releases\">Python<\/a>, <a href=\"https:\/\/code.visualstudio.com\/updates\/\">Jupyter<\/a> and <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/blob\/main\/CHANGELOG.md\">Pylance<\/a> extensions.<\/p>\n<h2>Python Environments Quick Create command<\/h2>\n<p>The <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-python-envs\">Python Environments<\/a> extension (preview) has added support for Quick Create, making the environment creation process more seamless. Quick Create minimizes the input needed from you to create new virtual environments by detecting the latest Python version on your machine to create an environment and install any workspace dependencies with a single click. This will create a <code>.venv<\/code> in your workspace for venv based environments, and <code>.conda<\/code> conda for conda based environments.<\/p>\n<p>You can access Quick Create via the <code>Python: Create Environment<\/code> command in the Command Palette.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-10058\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create.png\" alt=\"Screenshot showing the Quick Create environment creation option in the Create Environment Quick Pick.\" width=\"1126\" height=\"269\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create.png 1126w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create-300x72.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create-1024x245.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-envs-quick-create-768x183.png 768w\" sizes=\"(max-width: 1126px) 100vw, 1126px\" \/><\/a><\/p>\n<h2>Python Environments chat tools<\/h2>\n<p>The <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-python-envs\">Python Environments<\/a> extension now includes two chat tools: \u201cGet Python Environment Information\u201d and \u201cInstall Python Package\u201d. To use these tools, you can either directly reference them in your prompt by adding <code>#pythonGetEnvironmentInfo<\/code> and <code>#pythonInstallPackage<\/code>, or agent mode will automatically call the tool as applicable.<\/p>\n<p>&#8220;Get Python Environment Information&#8221; seamlessly detects the appropriate environment information based on your file or workspace context. This includes the Python version, installed packages, and their versions.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-get-env-tool.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-10059\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-get-env-tool.gif\" alt=\"Copilot using the Get Python Environment Information tool to fetch relevant environment information.\" width=\"1728\" height=\"1008\" \/><\/a><\/p>\n<p>&#8220;Install Python Package&#8221; automatically installs packages in the correct environment based on your workspace context. This means you can easily install packages without worrying about which environment you&#8217;re in or which package manager to use.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-install-pkg-tool.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-10060\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/python-install-pkg-tool.gif\" alt=\"Copilot calling the Install Python Package tool to automatically install required Python packages.\" width=\"1728\" height=\"1008\" \/><\/a><\/p>\n<h2>Automatic environment activation with Python Environments (Experimental)<\/h2>\n<p>The <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.vscode-python-envs\">Python Environments<\/a> extension introduced a new mechanism to auto activate your terminals with the correct environment information. The new <code>\"python-envs.terminal.autoActivationType\"<\/code> setting can be set to <code>command<\/code> (default), <code>shellStartup<\/code>, or <code>off<\/code>.<\/p>\n<p>When set to <code>command<\/code>, the Python environments extension sends the appropriate activation command directly to the terminal resulting in activation.<\/p>\n<p>Alternatively, with shell startup activation (<code>shellStartup<\/code>), the extension updates your shell\u2019s startup script (such as .bashrc, .zshrc, or PowerShell profile) so that whenever you open a new terminal in VS Code, your chosen Python environment is automatically activated. This is only enabled for the zsh, fsh, pwsh, bash, and cmd. Once changes are written to your shell profile, your terminals will need to be refreshed in order for activation to occur.<\/p>\n<p>If you want to undo these changes, simply run the <strong>Python Envs: Revert Shell Startup Script Changes<\/strong> command from the Command Palette. This will restore your shell profile and switch back to the previous activation mode.<\/p>\n<h2>Color picker with Pylance<\/h2>\n<p>Pylance can now display an interactive color swatch directly in the editor for recognized color values in Python files, making it easier to visualize and pick colors on the fly. To try it out, you can enable it by adding <code>setting(python.analysis.enableColorPicker:true)<\/code> to your <code>settings.json<\/code> file. Supported formats include #RGB (like &#8220;#001122&#8221;) and #RGBA (like &#8220;#001122FF&#8221;).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-10055\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker.png\" alt=\"Screenshot showing Pylance color picker when hex codes are available in your Python code.\" width=\"1433\" height=\"925\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker.png 1433w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker-300x194.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker-1024x661.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-color-picker-768x496.png 768w\" sizes=\"(max-width: 1433px) 100vw, 1433px\" \/><\/a><\/p>\n<h2>AI Code Actions: Convert Format String (Experimental)<\/h2>\n<p>When using Pylance, there&#8217;s a new experimental AI Code Action for converting string concatenations to f-string or <code>format()<\/code> enabled via <code>\"python.analysis.aiCodeActions\": {\"convertFormatString\": true}<\/code> setting. To try it out, select the <strong>Convert to f-string with Copilot<\/strong> or the <strong>Convert to format() call with Copilot<\/strong> Code Actions via the light bulb when selecting a symbol in the string you wish to convert, or through <code>Ctrl + .<\/code> \/ <code>Cmd + .<\/code>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-10056\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string.png\" alt=\"Convert strings Code Actions, powered by Copilot.\" width=\"1904\" height=\"680\" srcset=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string.png 1904w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string-300x107.png 300w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string-1024x366.png 1024w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string-768x274.png 768w, https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2025\/05\/pylance-convert-string-1536x549.png 1536w\" sizes=\"(max-width: 1904px) 100vw, 1904px\" \/><\/a><\/p>\n<p>Then once you define a new symbol, for example, a class or a function, you can select the <strong>Generate Symbol with Copilot<\/strong> Code Action and let AI handle the implementation! If you want, you can then leverage Pylance&#8217;s <strong>Move Symbol<\/strong> Code Actions to move it to a different file.<\/p>\n<h2>PyConUS 2025<\/h2>\n<p>We will be attending <a href=\"https:\/\/us.pycon.org\/2025\/\">PyCon US 2025<\/a> in Pittsburgh, PA, May 14-22, and cannot wait to connect with you all! Stop by booth #301 to say hello, learn along with us, and grab some swag!<\/p>\n<p>There are a number of amazing earned and sponsored talks our team will be giving, so make sure to add them to your schedule:<\/p>\n<table>\n<thead>\n<tr>\n<th>Date<\/th>\n<th>Time<\/th>\n<th>Location<\/th>\n<th>Talk<\/th>\n<th>Speaker(s)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Wednesday, May 14th\u200b<\/td>\n<td>9 a.m.\u201312:30 p.m. \u200b<\/td>\n<td>Room 320\u200b<\/td>\n<td>AI crash course for Python developers &#8211; PyCon US 2025\u200b<\/td>\n<td>Anthony Shaw \u200b<\/td>\n<\/tr>\n<tr>\n<td>Wednesday, May 14th\u200b<\/td>\n<td>1:30 p.m.\u20135 p.m. \u200b<\/td>\n<td>Room 317\u200b<\/td>\n<td>Snakes in a Grid: Working with spreadsheets in Python + Python in Excel &#8211; PyCon US 2025\u200b<\/td>\n<td>Sarah Kaiser\u200b<\/td>\n<\/tr>\n<tr>\n<td>Thursday, May 15th\u200b<\/td>\n<td>3:30 p.m.\u20134:30 p.m. \u200b<\/td>\n<td>Room 316\u200b<\/td>\n<td>Build modern Python apps on Azure (Sponsor: Microsoft) &#8211; PyCon US 2025\u200b<\/td>\n<td>Rohit Ganguly, Pamela Fox\u200b<\/td>\n<\/tr>\n<tr>\n<td>Saturday, May 17th\u200b<\/td>\n<td>4:15 p.m.\u20134:45 p.m.<\/td>\n<td>Room 301-305\u200b<\/td>\n<td>What they don&#8217;t tell you about building a JIT compiler for CPython &#8211; PyCon US 2025\u200b<\/td>\n<td>Brandt Bucher\u200b<\/td>\n<\/tr>\n<tr>\n<td>Sunday, May 18th\u200b<\/td>\n<td>1 p.m.\u20131:30 p.m.<\/td>\n<td>Room 301-305 \u200b<\/td>\n<td>Going faster in all directions at once: How two teams are working together to make Python better for all &#8211; PyCon US 2025\u200b<\/td>\n<td>Michael Droettboom<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Other Changes and Enhancements<\/h2>\n<p>We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:<\/p>\n<ul>\n<li>Branch coverage for Python is now supported in the Testing Explorer! Note that your <code>coveragepy<\/code> version must be &gt;= 7.7 for this feature. You can upgrade coverage by running <code>pip install coverage==7.7<\/code>.<\/li>\n<\/ul>\n<h2>We would also like to extend special thanks to this month&#8217;s contributors:<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/hutch3232\">@hutch3232<\/a> Prevent native REPL from caching state in between sessions in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/24857\">vscode-python#24857<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/danila-grobov\">@danila-grobov<\/a> Django tests run with coverage in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/24927\">vscode-python#24927<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/kinto0\">@kinto0<\/a> Disable language services if Pyrefly extension is installed and active in <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/pull\/24987\">vscode-python#24987<\/a><\/li>\n<\/ul>\n<p>Try out these new improvements by downloading the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python extension<\/a> and the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter extension<\/a> from the Marketplace, or install them directly from the extensions view in Visual Studio Code (Ctrl + Shift + X or \u2318 + \u21e7 + X). You can learn more about <a href=\"https:\/\/code.visualstudio.com\/docs\/python\/python-tutorial\">Python support in Visual Studio Code<\/a> in the documentation. If you run into any problems or have suggestions, <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/issues\/new\/choose\">please file an issue<\/a> on the <a href=\"https:\/\/github.com\/Microsoft\/vscode-python\">Python VS Code GitHub page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The May 2025 release includes updates in the Python Environments extension, a new color picker added by Pylance, branch coverage support, and more!<\/p>\n","protected":false},"author":99209,"featured_media":10119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[17],"class_list":["post-10054","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"acf":[],"blog_post_summary":"<p>The May 2025 release includes updates in the Python Environments extension, a new color picker added by Pylance, branch coverage support, and more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/10054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/users\/99209"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=10054"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/10054\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media\/10119"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/media?parent=10054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=10054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=10054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}