Microsoft is changing the way it bundles Python in Visual Studio
Microsoft’s popular integrated development environment (IDE), Visual Studio, is used by many developers around the world. The company recently released Visual Studio 2022 which contains lots of UI enhancements for Windows and Mac, performance enhancements, and more. Interestingly, the Redmond tech giant is also changing the way it bundles Python with each IDE release, which it described in more detail in its recent blog post.
Traditionally, each new release of Visual Studio targets a specific version of Python. For example, Visual Studio 2019 comes with Python 3.7 while Visual Studio 2022 supports Python 3.9 by default. However, Python’s release cadence is a bit tricky as new versions are released every year, but binary Windows installers are usually available for 18 months after release. This means that under the current lifecycle, if the lifespan of Visual Studio 2022 extends beyond 18 months, it will bundle an outdated version of Python (Python 3.9).
Microsoft has now changed its Python clustering policy to address this issue. Now, new versions of Visual Studio will target the most recent widely adopted version of Python. In essence, this indicates that when Visual Studio 2022 is updated in the near future, new versions of the IDE may bundle Python 3.10 or newer, depending on the “widely adopted” version.
That said, older versions of Python workloads will not be updated to support new versions. Microsoft will explicitly mark these outdated versions of Python as “Out of Support” when installing Visual Studio, but will not remove or add new versions to this installation.
Microsoft explained its reasoning as follows:
- We want to mark older versions as “out of support” and not select them by default to make it clear that these versions of Python are indeed past their end of life and may have security vulnerabilities;
- At the same time, we don’t want to remove them, as customers may still need them; code is often updated to support new versions slowly, if at all, and in many cases the security issues that may exist are edge cases that may not be relevant; customers should use their own judgment about the risks involved in continuing to use older versions of Python;
- With the exception of adding the Python 3.9 installer to Visual Studio 2019, we don’t want to add installers for new versions of Python which may not be fully supported by the Python payload. Python work; you can use newer versions of Python to run your old code in most cases without issue, but we want to avoid giving the impression that Python language changes are fully supported by older versions of Visual Studio when they are not;
- In most cases, you can simply install a newer version of Python from https://python.org or the Windows store and use your existing Python code as is; the number of breaking changes between Python versions is small and usually in extreme cases.
Visual Studio 2019 ships with Python 3.9, but it will also be marked out of support next year once it reaches the end of its lifecycle. Microsoft pointed out that this change to its clustering strategy will make it easier to reconcile the delta between the widely available version of Python and Visual Studio’s Python language server, Pylance.