Click here to Skip to main content
13,896,986 members
Click here to Skip to main content
Add your own
alternative version

Stats

2.5K views
3 bookmarked
Posted 6 Jan 2019
Licenced CPOL

Setup and Test Python Environment in Existing Visual Studio 2017

, 6 Jan 2019
Rate this:
Please Sign up or sign in to vote.
This article will help you to understand how to setup Python environment in existing Visual Studio 2017. If you don’t have Visual Studio 2017 installed and you would like to install it, then you can refer to the below article for step by step information.

Introduction

In 2018, Python is in the list of most popular languages as per Stack Overflow Developer Survey. Python is a cross-platform and open source programming language for Machine Learning, Web Development and Data Science. There are lots of editors available for Python development but as a Dotnet Developer, you always love Visual Studio and always prefer to work with this IDE. Visual Studio provides lots of features which help us in faster and productive development, due to this, it's the number one IDE. But when you think about Python development, you might think which editor is best for it. But don't worry, Microsoft has added Python development in Visual Studio and now we can use Visual Studio for Python development as well.

Background

This article will help you to understand how to setup Python environment in the existing Visual Studio 2017. If you don’t have Visual Studio 2017 installed and you would like to install it, then you can refer to the below Microsoft article for step by step information.

Set Up Python Environment

So, before moving forward, please make sure that you should have installed Visual Studio 2017. Let's open Visual Studio Installer from the start menu, if you are not able to find it in the program, then you can search it and open. The Visual Studio Installer is responsible for adding new components, modifying existing components and updating the current components with a new one. So, basically, it is used for maintaining the components for your development environment.

Visual Studio Installer

Sometimes, before starting the Visual Studio Installer, it automatically updates the installer and then opens. Next screen will be for your Visual Studio product from where you can update or modify it. I am using Visual Studio 2017 Enterprise Version. If you have not updated your existing Visual Studio 2017 for a long time, then you can see an “Update” option, so let's first update the Visual Studio 2017 and then we will try to add Python environment.

Visual Studio 2017 Update

Once your Visual Studio 2017 will be updated through Visual Studio Installer, the "Update" option will convert into "Modify" from where we can modify our existing development environment.

Visual Studio Modfiy

Just click to Modify button and it will open the Workloads installation windows from where you can choose the required components for specific development area. From here, just scroll and you will find the Python Development as you can see in the below image.

Once you select “Python Development”, at the right panel, you can find Installation Details where you can see all components as selected which are going to install. Just select which components, you are willing to install and click to “Modify” button.

Modify Visual Studio

It will take some time and it totally depends on your network connection speed and size of data that needs to be downloaded for installation.

Python Installation

Once installation will be completed, you have to do one thing before going to click on the Launch button for opening Visual Studio. Just go to the following location and delete all files inside this folder.

C:\Users\USER_NAME\AppData\Local\Microsoft\VisualStudio\LATEST_VERSION\ComponentModelCache

Now, click on the Launch button and it will open Visual Studio 2017.

So, here, we have successfully added the Python environment with Visual Studio 2017 and it's time to check that we have installed it correctly or not. So, just press "Alt+I" and it will open Interactive Windows. In this window, just select environment as Python and module as "__main__" and type some Python command, for instance, let the sum of two numbers (4+4) or print something as shown in the following image. If it returns output correctly, it means, congrats you are able to set up your Python environment in Visual Studio 2017.

Run Python

Conclusion

So, today, we have learned how to setup Python environment in existing Visual Studio 2017.

I hope this post will help you. Please give your feedback using comments which will help me to improve myself for the next post. If you have any doubts, please ask in the comment section and if you like this post, please share it with your friends. Thanks!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

MukeshKumarTech
Software Developer
India India
A Software Developer, Microsoft MVP, C# Corner MVP, Blogger and has extensive experience with designing and developing enterprise scale applications on Microsoft .NET Framework.

http://www.mukeshkumar.net
https://www.linkedin.com/in/mukeshkumartech

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190306.1 | Last Updated 6 Jan 2019
Article Copyright 2019 by MukeshKumarTech
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid