{"id":1635,"date":"2017-12-07T12:00:32","date_gmt":"2017-12-07T20:00:32","guid":{"rendered":"http:\/\/blogs.msdn.microsoft.com\/pythonengineering\/?p=1635"},"modified":"2019-02-17T15:27:02","modified_gmt":"2019-02-17T22:27:02","slug":"whats-new-for-python-in-visual-studio-15-6-preview-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/python\/whats-new-for-python-in-visual-studio-15-6-preview-1\/","title":{"rendered":"What&#8217;s new for Python in Visual Studio 2017 15.6 Preview 1"},"content":{"rendered":"<p>Today we have released the first preview of our next update to Visual Studio 2017. You will see a notification in Visual Studio within the next few days, or you can download the new installer from <a href=\"https:\/\/visualstudio.com\/vs\/preview\" target=\"_blank\">visualstudio.com<\/a>.<\/p>\n<p>In this post, we&#8217;re going to take a look at some of the new features we have added for Python developers. As always, the preview is a way for us to get features into your hands early so you can provide feedback and we can identify issues with a smaller (and hopefully more forgiving!) audience. If you encounter any trouble, please use the Report a Problem tool to let us know.<\/p>\n<h2>Immediate IntelliSense updates with no database<\/h2>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/NoIntellisenseDB.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/NoIntellisenseDB-300x294-1.png\" alt=\"Before and after images of the IntelliSense pane of the Python Environments window\" width=\"300\" height=\"294\" class=\"alignright size-medium wp-image-1656\" \/><\/a><\/p>\n<p>Remember how every time you installed or updated a package we would make you wait for hours while we &#8220;refresh&#8221; our &#8220;completion DB&#8221;? No more! In this update we are fundamentally changing how we handle this for installed Python environments, including virtual environments, so that we can provide IntelliSense immediately without the refresh.<\/p>\n<p>This has been available as an experimental feature for a couple of releases, and we think it&#8217;s ready to turn on by default. When you open the Python Environments window, you&#8217;ll see the &#8220;IntelliSense&#8221; view is disabled and there is no longer a way to refresh the database &#8212; because there is no database!<\/p>\n<p>The new system works by doing lightweight analysis of Python modules as you import them in your code. This includes <tt>.pyd<\/tt> files, and if you have <tt>.pyi<\/tt> files alongside your original sources then we will prefer those (see <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0484\/#stub-files\" target=\"_blank\">PEP 484<\/a> for details of <tt>.pyi<\/tt> files. In essence, these are Python &#8220;include&#8221; files for editors to obtain information about Python modules, but do not actually have any code in them &#8211; just function stubs with type annotations).<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_pandas.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_pandas-1.png\" alt=\"Completions in the editor from the pandas package\" width=\"285\" height=\"218\" class=\"alignleft size-full wp-image-1646\" \/><\/a><\/p>\n<p>You should notice some improvements in IntelliSense for packages like <tt>pandas<\/tt> and <tt>scikit-learn<\/tt>, though there will likely be some packages that do not work as well as before. We are actively working on improving results for various code constructs, and you will also see better IntelliSense results as packages start including <tt>.pyi<\/tt> type hint files. We encourage you to post on <a href=\"https:\/\/github.com\/Microsoft\/PTVS\/issues\/3046\" target=\"_blank\">this github issue<\/a> to let us know about libraries that still do not work well.<\/p>\n<p>(NOTE: If you install this preview alongside an earlier version of Visual Studio 2017, the preview of this feature will also be enabled in earlier version. You can go back to the old model by disabling the feature in Preview. To do this, open Tools, Options, find the Python\/Experimental page, deselect &#8220;Use new style IntelliSense&#8221; and restart both versions of Visual Studio.)<\/p>\n<h2>conda integration<\/h2>\n<p>If you use Anaconda, you likely already manage your environments and packages using the <tt>conda<\/tt> tool. This tool installs pre-built packages from the <a href=\"https:\/\/repo.continuum.io\/pkgs\/free\/win-64\/\" target=\"_blank\">Anaconda repository<\/a> (warning: <em>long<\/em> page) and manages compatibility with your environment and the other packages you have installed.<\/p>\n<p>For this preview of Visual Studio, we have added two experimental options to help you work with Anaconda:<\/p>\n<ul>\n<li>Automatically detect when <tt>conda<\/tt> is a better option for managing packages<\/li>\n<li>Automatically detect any Anaconda environments you have created manually<\/li>\n<\/ul>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Install_Bokeh.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Install_Bokeh-1.png\" alt=\"Install package from conda in the Python environments window\" width=\"628\" height=\"216\" class=\"alignnone size-full wp-image-1665\" \/><\/a><\/p>\n<p>To enable either or both of these features, open Tools, Options, find the Python\/Experimental page, and select the check box. For this preview we are starting with both disabled to avoid causing unexpected trouble, but we intend to turn them on by default in a future release.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Options_Conda.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Options_Conda-300x175-1.png\" alt=\"Options dialog with experimental conda options highlighted\" width=\"300\" height=\"175\" class=\"alignright size-medium wp-image-1657\" \/><\/a><\/p>\n<p>With &#8220;Automatically detect Conda environments&#8221; enabled, any environments created by the <tt>conda<\/tt> tool will be detected and listed in the Python Environments window automatically. You can open interactive windows for these environments, assign them in projects or make them your default environment.<\/p>\n<p>With the &#8220;Use Conda package manager when available&#8221; option enabled, any environments that have <tt>conda<\/tt> installed will use that for search, install and updating instead of <tt>pip<\/tt>. Very little will visibly change, but we hope you&#8217;ll be more successful when adding or removing packages to your environment.<\/p>\n<p>Notice that these two options work independently: you can continue to use <tt>pip<\/tt> to manage packages if you like, even if you choose to detect environments that were created with <tt>conda<\/tt>. If you are an Anaconda user, you will likely want to enable both options. However, if you do this and encounter issues, disabling each one in turn and then reporting any differences will help us quickly narrow down the source.<\/p>\n<h2>Other improvements<\/h2>\n<p>We have made a range of other <a href=\"https:\/\/github.com\/Microsoft\/PTVS\/pulls?utf8=%E2%9C%93&amp;q=is%3Apr+base%3Amaster+merged%3A2017-09-20..2017-12-01+-author%3Acsigs+\" target=\"_blank\">minor improvements and bug fixes<\/a> throughout all of our Python language support and there are more to come.<\/p>\n<p>Our &#8220;IPython interactive mode&#8221; is now using the latest APIs, with improved IntelliSense and the same module and class highlighting you see in the editor.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/JupyterClient_Version.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/JupyterClient_Version-1.png\" alt=\"Interactive window showing current jupyter_client version and improved syntax highlighting\" width=\"482\" height=\"194\" class=\"alignnone size-full wp-image-1716\" \/><\/a><\/p>\n<p>There are new code snippets for the <a href=\"https:\/\/docs.python.org\/3\/library\/argparse.html\" target=\"_blank\"><tt>argparse<\/tt><\/a> module. Start typing &#8220;arg&#8221; in the editor to see what is available.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_argparse.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_argparse-1.png\" alt=\"In the editor adding an argparse snippet.\" width=\"513\" height=\"150\" class=\"alignnone size-full wp-image-1705\" \/><\/a><\/p>\n<p>We&#8217;ve also added new color customization options for docstrings and regular expression literals (under Tools, Options, Fonts and Colors). Doc strings have a new default color.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_RegexLiteral.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/python\/wp-content\/uploads\/sites\/12\/2017\/12\/Editor_RegexLiteral-1.png\" alt=\"Doc strings and regex literal strings with customized colors\" width=\"594\" height=\"104\" class=\"alignnone size-full wp-image-1715\" \/><\/a><\/p>\n<p>If you encounter any issues, please use the Report a Problem tool to let us know (this can be found under Help, Send Feedback) or continue to use our <a href=\"https:\/\/github.com\/Microsoft\/PTVS\" target=\"_blank\">github<\/a> page. Follow <a href=\"https:\/\/devblogs.microsoft.com\/python\/\">our blog<\/a> to make sure you hear about our updates first, and thanks for using Visual Studio!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we have released the first preview of our next update to Visual Studio 2017. You will see a notification in Visual Studio within the next few days, or you can download the new installer from visualstudio.com. In this post, we&#8217;re going to take a look at some of the new features we have added [&hellip;]<\/p>\n","protected":false},"author":1333,"featured_media":10119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio"],"acf":[],"blog_post_summary":"<p>Today we have released the first preview of our next update to Visual Studio 2017. You will see a notification in Visual Studio within the next few days, or you can download the new installer from visualstudio.com. In this post, we&#8217;re going to take a look at some of the new features we have added [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/1635","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\/1333"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/comments?post=1635"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/posts\/1635\/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=1635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/categories?post=1635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/python\/wp-json\/wp\/v2\/tags?post=1635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}