Setup Python (Anaconda) Environment in Visual Studio

Installing Python (Anaconda)

In the old days, setting up an python environment with packages like NumPy SciPy in Windows may takes several hours. This may include building NumPy or SciPy yourself.

Now, to save our day, we can actually just install them easily by some special distributions like:

Here, I am going to install Anaconda, simply download the Windows installer and you are done.

Setup Visual Studio as your Python IDE

To use Visual Studio as your Python IDE, we can install the Python Tools for Visual Studio (PTVS).

Setup Python Environment – Anaconda

Now that we have installed (PTVS), we have to tell (PTVS) where to find our Python distributions, in this case, the one that Anaconda installed. We can configu it from:

From Visual Studio –> Options –> Python Tools –> Environment Options

We can setup our new Anaconda environment like this:

Once we have finished the setup, we can create a Python Project in Visual Studio, then try to run it our script using :

From Visual Studio –> Options –> Python Tools –> Execute Project in Python Interactive