Book Image

Python Tools for Visual Studio

Book Image

Python Tools for Visual Studio

Overview of this book

Table of Contents (13 chapters)

Step-by-step installation and configuration


There are various formats of PTVS available for installation depending on your preexisting installed version of Visual Studio. PTVS is available for Visual Studio 2010, 2012, and 2013 (Pro edition or above).

If the previously mentioned versions of Visual Studio are not installed on your computer, it's possible to install a standalone version of PTVS. Visual Studio permits side-by-side installation, meaning it provides the ability to install multiple versions on one system. The only prerequisite is that the older version must be installed before the newer one.

The different types of installations possible for PTVS are described on its CodePlex website, http://go.microsoft.com/fwlink/?LinkID=390659.

The preceding figure is taken from http://go.microsoft.com/fwlink/?LinkID=390659.

The most important prerequisite for Visual Studio 2013 is to have Windows 7 (32 or 64 bit) or above running as your operating system.

Once you have sorted out the prerequisites and installed the PTVS package of your choice, you will need to decide on the type of Python interpreter. Choosing the appropriate Python interpreter depends on your need for your project. Refer to the PTVS CodePlex page at http://go.microsoft.com/fwlink/?LinkID=299429 to help your decision-making process. You can choose between CPython and IronPython (32 or 64 bit). If you chose CPython, then you can choose between Python Version 2.7 and 3.3. It is recommended to use CPython 3.3 32 bit for most cases. For web development, the recommendation would be CPython 2.7 32 bit.

Make your choice based on what you intend to do and the framework that you will be using with Python. For the scope of this book, we suggest to install the 32-bit CPython Version 2.7. For the latest complete list of downloadable Python interpreters, please refer to the PTVS CodePlex page at http://go.microsoft.com/fwlink/?LinkID=390659.

Once the interpreter is installed, you can fire up PTVS by opening the Visual Studio 2013 application from the Start menu. If everything works, this is what you are going to see on your screen:

Let's check whether the whole system works properly. Create a new project and see if it runs as follows:

  1. To create a new project, navigate to the New Project menu under File to launch the New Project dialog box.

  2. Select Python Application and click on OK. This will create a new project and a basic Hello World Python application file.

  3. Start the app by clicking on the Start button in the toolbar, or just hit F5.

  4. If you have any previous installations of Python on your system, you should see the application response window with the Hello World message, as shown in the following screenshot: