{"id":9313,"date":"2023-03-31T08:30:05","date_gmt":"2023-03-31T16:30:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/python\/?p=9313"},"modified":"2023-03-31T08:30:05","modified_gmt":"2023-03-31T16:30:05","slug":"python-in-visual-studio-code-april-2023-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/python-in-visual-studio-code-april-2023-release\/","title":{"rendered":"Python in Visual Studio Code &#8211; April 2023 Release"},"content":{"rendered":"<p>We\u2019re excited to announce that the April 2023 release of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-python.python\">Python<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.jupyter\">Jupyter<\/a> extensions for Visual Studio Code are now available!<\/p>\n<p>This release includes the following announcements:<\/p>\n<ul>\n<li>Data Wrangler available for Visual Studio Code Insiders<\/li>\n<li>Move symbol refactoring<\/li>\n<li><strong>Create Environment<\/strong> button embedded in dependency files<\/li>\n<li>Environments API for extension authors<\/li>\n<li>Kernel Picker Improvements for Python Environments<\/li>\n<\/ul>\n<p>If you\u2019re 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:\/\/github.com\/microsoft\/vscode-jupyter\/blob\/main\/CHANGELOG.md\">Jupyter<\/a> and <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/blob\/main\/CHANGELOG.md\">Pylance<\/a> extensions.<\/p>\n<h2>Data Wrangler available for Visual Studio Code Insiders<\/h2>\n<p>Data Wrangler, a revolutionary tool for data scientists and analysts who work with tabular data in Python, is now available on <a href=\"https:\/\/code.visualstudio.com\/insiders\/\">VS Code Insiders<\/a>. Data Wrangler is an <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-toolsai.datawrangler\">extension for VS Code Insiders<\/a> and can be launched from any Pandas dataframe output in a Jupyter notebook, or by right-clicking any CSV or Parquet file in VS Code Insiders and selecting <strong>Open in Data Wrangler<\/strong>.<\/p>\n<p>With Data Wrangler, you can seamlessly clean and explore your data in VS Code Insiders. It offers a variety of features that will help you quickly identify and fix errors, inconsistencies, and missing data. You can perform data profiling and data quality checks, visualize data distributions, and easily transform data into the format you need. Plus, Data Wrangler comes with a library of built-in transformations and visualizations, so you can focus on your data, not the code. As you make changes, the tool generates code using open-source Python libraries for the data transformation operations you perform. This means you can write better data preparation programs faster and with fewer errors. The code also keeps Data Wrangler transparent and helps you verify the correctness of the operation as you go.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/15910920\/222234663-5e8178f8-851f-4326-8719-9d90039ce023.gif\" alt=\"View data summary and fill missing values with Data Wrangler\" \/><\/p>\n<p>To learn more about Data Wrangler, read our full <a href=\"https:\/\/devblogs.microsoft.com\/python\/data-wrangler-release\/\">Data Wrangler<\/a> release blog.<\/p>\n<h2>Move symbol refactoring<\/h2>\n<p>You can now more conveniently refactor your Python code with Pylance, thanks to the new <strong>Move symbol<\/strong> Code Action! We&#8217;re excited about this enhancement as it&#8217;s one of the most requested features in the Pylance repository <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/discussions\/2620\">pylance-release\/discussion#2620<\/a>.<\/p>\n<p>To try it out, select a symbol in a Python file and click on the light bulb that is presented (<code>kb(editor.action.quickFix)<\/code>). You can either move the symbol to an existing file or to a new file. If the location is a new file, a Python file is created with the same name as your symbol. All the applicable import references are automatically updated with the symbol move.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/03\/move_symbol_refactoring.gif\" alt=\"Using the Move Symbol To code action with Pylance\" \/><\/p>\n<h2><strong>Create Environment<\/strong> embedded in dependency files<\/h2>\n<p>The <strong>Python: Create Environment<\/strong> command is now embedded in dependency files. When you open a <code>requirements.txt<\/code> or a <code>pyproject.toml<\/code> file with a <code>[build-system]<\/code> table, there&#8217;s a new <strong>Create Environment&#8230;<\/strong> button in the editor that runs the <strong>Python: Create Environment<\/strong> command, allowing you to create a new virtual environment and install the listed dependencies.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/03\/create-env-python-dependencies-files.png\" alt=\"A &#96;pyproject.toml&#96; file open with dependencies listed, and a **Create Environment** button displayed on the bottom right corner for the editor\" \/><\/p>\n<h2>Environments API for extension authors<\/h2>\n<p>The Python extension&#8217;s API to work with Python environments available in the user&#8217;s machine has now been finalized. Extensions can also use it to access the selected environment path that&#8217;s used by the Python extension to run scripts, or update it to their preferred one.<\/p>\n<p>Example usages can be found in the <a href=\"https:\/\/github.com\/microsoft\/vscode-python\/wiki\/Python-Environment-APIs#extension-api-usage\">Python Environment APIs<\/a> wiki page. We are also planning to release an npm types package in the future so it&#8217;s easier to keep track of any changes in the Python API.<\/p>\n<h2>Kernel Picker Improvements for Python Environments<\/h2>\n<p>The kernel picker now lists Conda environments without Python installed in them.<\/p>\n<p>For instance, if a new Conda environment is created using a CLI such as <code>conda create -n envML<\/code>, this new environment will be displayed in the list of <a href=\"https:\/\/code.visualstudio.com\/docs\/datascience\/jupyter-kernel-management#_python-environments\">Python Environments<\/a> under the <strong>Conda Env Without Python<\/strong> section.<\/p>\n<p>Upon selecting such an environment, the Python runtime and necessary dependencies will be automatically installed into the selected environment.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2023\/03\/conda-env-without-python.png\" alt=\"Jupyter feature showing Conda environments without Python installed in them\" \/><\/p>\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>Autocomplete keys for <code>get<\/code> method <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/issues\/3994\">(pylance-release#3994)<\/a><\/li>\n<li>Remove support for <code>python.linting.ignorePatterns<\/code> <a href=\"https:\/\/github.com\/microsoft\/pylance-release\/issues\/4100\">(pylance-release#4100)<\/a><\/li>\n<li>IntelliSense improvements when using Pylance for packages such as lightgbm, networkx, vispy, cv2, matplotlib, and sklearn, thanks to new and\/or updated type stubs<\/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 April 2023 release of the Python and Jupyter extensions for Visual Studio Code are now available. This release includes Data Wrangler, a create environment button embedded in dependency files, environments API for extension authors, kernel picker improvements, and move symbol refactoring. Keep reading to learn 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-9313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"acf":[],"blog_post_summary":"<p>The April 2023 release of the Python and Jupyter extensions for Visual Studio Code are now available. This release includes Data Wrangler, a create environment button embedded in dependency files, environments API for extension authors, kernel picker improvements, and move symbol refactoring. Keep reading to learn more!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9313","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=9313"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/9313\/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=9313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=9313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=9313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}