Home Ā» The VS Code Python extension package does not pre-install the Jupyter extension package | iThome

The VS Code Python extension package does not pre-install the Jupyter extension package | iThome

by admin
The VS Code Python extension package does not pre-install the Jupyter extension package | iThome

Microsoft released an updated version of Python in VS Code in May 2023. This version has made some minor adjustments in the settings, including not pre-installing the Jupyter extension package, and using Microven as an alternative to the venv suite. In addition, it also adds automatic conversion f- strings experimental features.

Starting from this version, the VS Code Python extension package will not install the Jupyter extension package at the same time by default. The official explanation behind this decision is to meet the needs of Dev Containers users to quickly create containers. The VS Code Dev Containers extension allows developers to use containers as a full-featured development environment. Developers can open any folder in the container, or mount a folder to the container, and use the full functionality of VS Code.

In the past, the Python extension package would install the Jupyter extension package in remote Dev Containers. This behavior slowed down the container configuration process because users had to manually uninstall it. Now Microsoft cancels the default installation function of the Jupyter extension kit, which can make the container creation process smoother. Users who want to use the Jupyter extension kit can add the Jupyter extension kit ID to the devcontainer.json file by modifying the configuration file of the extension kit. You can use the Jupyter Notebooks function in the container again.

In the new version of the Python extension kit, Microvenv now also supports creating environment commands. When the developer environment does not have the venv kit installed, but uses the Python: Create environment command, the Python extension kit will use Microvenv as an alternative to avoid Python: Create An error occurred in the environment directive. Microvenv is a lightweight Python module that can create virtual environments for Python projects in a very simple way.

See also  This AI can predict the death of a person with 78% accuracy

The Python extension package was updated in May to add an experimental function that is turned off by default, which can automatically convert strings to f-strings format. Users only need to enable the python.analysis.autoFormatStrings setting, and Pylance will insert the { symbol in the quotation marks when the developer , automatically add f at the beginning of strings, and convert the entire string into f-strings.

f-strings (Formatted String Literals) is a new string formatting method added after Python 3.6, which allows developers to embed expressions in strings and format the values ā€‹ā€‹of these expressions directly into strings. As long as the letter f is added before the string, it can be said that the string is f-strings. The new default of the Python extension package further encourages developers to use f-strings, but this feature is currently disabled by default. The official mentioned that they still want to collect more feedback from users and plan to enable it in future versions.

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy