Released: Python support in Visual Studio 2017

Steve Dower

Today is launch day for Visual Studio 2017, and you can see all the info and join the live event at launch.visualstudio.com. But over in this corner of our world, we are announcing something special.

As you likely know, once software is officially released, it normally gets less frequent updates. For those of us who love getting new toys, this can be disappointing after an update-packed preview phase. For Visual Studio 2017, we significantly improved our install experience and added scenario-specific workloads, but also made it easier for us to service the product. This means everyone will see more frequent updates, and they’ll generally be faster and more targeted than in the past, but we can also provide our early adopters with access to features before anyone else.

Visual Studio 2017 and Visual Studio Preview

The Visual Studio Preview icon

As well as Visual Studio 2017, today we are also releasing Visual Studio Preview. This will be an early preview of what’s coming next for Visual Studio, just like those we have been releasing up to this point. Visual Studio Preview will receive updates a few weeks before the “stable” release, letting you try the latest and greatest improvements first.

In the past, installing a preview of Visual Studio has required using a completely separate machine. For Visual Studio 2017, we now have the ability to install and use Preview side-by-side with another install of Visual Studio. And while the Preview install is not officially supported (not “go live”), the main one remains fully supported and you can use both at the same time on the same machine.

(To be clear, if you’ve already installed Visual Studio 2017, this will install it again and you’ll have two separate installations with separate workloads and settings, both managed through the same Visual Studio Installer. Everything that is in Visual Studio 2017 is also in Preview, so you would only need both to take advantage of paid product support offerings, which are not available for Preview. The FAQ at the product page has more details.)

Why announce it here?

Python in Visual Studio Preview

You may be wondering why we are announcing Visual Studio Preview from the Python blog, rather than the main Visual Studio blog. The reason is that the first available feature in preview is the Python development workload!

This is the same Python support you’ve used since Visual Studio 2010 as Python Tools for Visual Studio, but now updated and enhanced for 2017. Let’s walk through some of the major changes, and we’ll be posting more blogs in the coming weeks diving deeper into each one.

Installation

As Python support is now part of the Visual Studio installer, we get to take advantage of the features it provides. In the screenshot below, you can see that when the Python development workload is selected, a list of optional components become available. These are either recommended Visual Studio features or third-party tools that we think you will find useful.

The Python development workload selected in the Visual Studio 2017 Preview installer

Firstly, you’ll see a range of Python versions available, as well as the Anaconda distribution from Continuum Analytics. These are coming straight from the external sites, so you can install them yourself and get exactly the same functionality, but we’re also making it a simple checkbox.

“Python native development tools” are actually Visual Studio’s regular C++ tools and compilers, but we’ve selected the correct versions for developing with Python 3.5 and later. See our earlier post for information about versions prior to 3.5.

We will discuss Cookiecutter template support below, and the other options are specialized Visual Studio features for Azure or Windows IoT Core. You’ll know (or you’ll be prompted in product) if you need these.

(Minor known issue – if you’ve already installed Python 3.6, you’ll want to deselect its checkbox when installing. Otherwise uninstalling VS will also uninstall Python.)

Interactive Windows

Python interactive windows showing code cells

We know that many of our users spend most of their time in interactive windows, so we have made some improvements for this release to make them more powerful. Expect a future blog post to go into more detail, but the highlights include:

  • You can now Ctrl+Enter in the editor to send to interactive
  • You can mark code cells with #%% and send them all at once
  • You can create as many interactive windows as you like, and choose the Python environment for each one

Cookiecutter

When Cookiecutter template support is installed, you will see new options appear under File, New Project and also the Add New Item menus. These will open our Cookiecutter Explorer window, which can help you find and use online templates.

Not familiar with Cookiecutter? Check out our previous blog walking through the new support.

Azure

For Visual Studio 2017, we’ve started an overhaul of how Python projects are created and deployed to Azure. Previously, we made it easy to get something simple up quickly, but we heard feedback that we weren’t well supporting people who were maintaining complex web applications.

New Azure-specific item templates in Visual Studio 2017

We expect this process to take some time, and we hope you’ll join us in this to help us get it right, but here are the changes from ealier versions so far:

(This area does have one known issue: you should select the “Azure Cloud Services core tools” optional component when installing for full Azure support. We’ll fix it as soon as we can.)

What plans do we have for the future?

Visual Studio Preview is a staging ground, so you can expect to see the Python development workload (and the Data Science workload) become available in the fully supported Visual Studio release within a few months. At that point, you can either remove Visual Studio Preview, or keep it around and enjoy the next set of early updates.

We are continuing to actively develop our Python support, and as in the past, all our development takes place on github, so if you would like to let us know what you need most, please come and file an issue. We also accept code and documentation contributions.

0 comments

Discussion is closed.

Feedback usabilla icon