We're excited to announce that the June 2022 Python and Jupyter extensions for VS Code are now available.
This release includes the following updates:
- localization support
- Python interpreter lookup
- Jupyter extension support on vscode.dev/github.dev
- A preview of Pylance
If you're interested, you can check out our blog for full updates on the Python , Jupyter , and Pylance extensions.
Improved localization support
The Python extension now supports translating all languages in VS Code. We've changed the way we get command, notification, and title text.
Subject: Horizon Extended . Language mode: Portuguese (Brazil) .
You can change the language VS Code displays by running the "Configure Display Language" command (Ctrl + Shift + P or ⌘ + ⇧ + P) in the Command Palette.
Find improvements to the Python interpreter
We've also improved the way VS Code triggers finding the Python interpreter.
Previously, the Python extension tried to find a Python interpreter every time it was activated or loaded. Starting with this release, finding an interpreter is only triggered when a new folder or workspace is opened for the first time, the "Python: Select Interpreter" command is triggered, and the interpreter list is refreshed. This reduces load times and makes the language server start up faster.
Note, however, that if the Jupyter extension is installed or enabled, Jupyter will still trigger finding an interpreter on startup. We are working hard to improve this process.
New Jupyter extensions on vscode.dev/github.dev
We've made progress in supporting more core functionality for Jupyter extensions in the new web release.
This month, we ported the following features to the web extension:
- https support
- Kernel completion
- ipywidgets
- Notebook debugging
- variable view
- export
- Interactive window
If you want to try the feature, you can start Jupyter from your local machine with the following command:
jupyter notebook --no-browser --NotebookApp.allow_origin_pat=https://.*\.vscode-cdn\.net
Then you can use "Jupyter: Specify Jupyter server for" in vscode.dev
connections" command to connect to it.
You can refer to this discussion item for more information and feedback.
Pre-release Pylance extension
The Pylance extension provides an Insiders program where you can get preview updates and try out the latest features and bug fixes early on. Before this version, we could opt-in to it via settings, then VS Code would download and install a new version every week, and a prompt reload window would be displayed to enable the new update.
Given that the Python extension successfully migrated its internals to pre-release in the March 2022 release , we are now doing the same for Pylance to provide a smoother opt-in and upgrade experience. You can open the extension view in VS Code (Ctrl + Shift + X or ⌘ + ⇧ + X), search for Pylance, and open the Pylance extension to install the pre-release version. If you already have the extension installed, you can click the "Switch to Pre-Release Version" button next to the "Uninstall" button:
If you don't have it installed, you can click the down arrow next to the "Install" button and select "Install Pre-Release Version":
If you are part of the Insiders program and have "pylance.insidersChannel" set to "daily", which previously automatically installed pre-release versions of the Pylance extension, this setting will also be removed.
If you are interested in getting the latest Python and Jupyter notebook features and bug fixes, you can install pre-release versions of Python and Jupyter extensions using the methods described above.
WWBD
Brett Cannon, Engineering Manager for Python Extensions and Python Steering Committee member, has created a new experimental extension for setting up a Python environment called WWBD ("What would Brett do").
With the "WWBD: Create environment" command, it provides a process for creating a virtual environment using venv , which automatically installs the dependencies listed in the workspace requirements file.
We're looking for feedback on the experience with this extension in the GitHub repository , and we're exploring the possibility of integrating this process into the Python extension itself in the future.
Other changes and enhancements
We've also added some small enhancements and user-requested fixes that should improve your experience with Python and Jupyter Notebooks in Visual Studio Code. Some notable changes include:
- Experimental feature: Pylance now treats each Jupyter notebook cell as a separate document, instead of concatenating the cells into a single document. This may fix the behavior of many Pylance notebooks. " python.pylanceLspNotebooksEnabled " can be enabled by setting: true.
- Improve the information collected by the "Python: Report Issue" command. ( vscode-python#19067 ).
- Jupyter notebooks no longer freeze when typing or executing ( pylance-release#2783 ).
- Show completion suggestions when overloading inherited class variables ( pylance-release#2059 ).
- Pylance now fetches stubs from the repository maintained by pandas-dev . Please open the pandas stubs issue there ( python-type-stubs#208 ).
We would also particularly like to thank this month's contributors:
- djplt : Automatically switch cursor focus to terminal after clicking the run button ( vscode-python#14851 ).
- Eric Wieser : Added alert box styling for notebooks ( vscode-jupyter#10034 ).
- Dr-Irv : Improvements to pandas stubs ( python-type-stubs#194 ).
- Denis Rosset : Improvements to matplotlib stubs ( python-type-stubs#197 ).
- abbymconnell : Added trailing comma to jsno noon example ( vscode-isort#48 ).
- Root Please : Fixed argv duplication bug ( vscode-black-formatter#57 ).
Try these new improvements by downloading the Python extension and Jupyter extension from the Marketplace, or install them directly from the Extensions view in Visual Studio Code (Ctrl + Shift + X or ⌘ + ⇧ + X ). You can learn more about VS Code Python in the documentation. If you run into any issues or want to make suggestions, please file an issue on the GitHub page.
Long press to identify the QR code
Follow Microsoft China MSDN
Click "Read the original text" [Learn more] ( https://code.visualstudio.com/docs/languages/python?ocid=AID3045631 )~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。