Using NumPy in Visual Studio

Two solutions worked for me:

  1. Going directly to my Python folder and installing the packages using pip.
  2. Creating a virtual environment in my project and installing packages from within Visual Studio.

In Visual Studio 2013 Community Edition with a Python 2.7 environment, the following worked for me:

Open the Python Environments menu in Solution Explorer, and click on "Install Python Package..."

Then write "numpy":


Consider using a more feature-rich Windows distribution of Python, like Anaconda. It comes with a boatload of packages included into the installer. This is quite handy for those who are new to Python, especially when they are using Windows.

Edit:

As of 2020, I would suggest using the python.org distribution of Python. Compiler issues on ms-windows have finally been fixed, so a lot of projects now provide binary packages (wheels) for ms-windows. Among others numpy, pandas, matplotlib, pillow, Cython and PyNaCl.

Note that wheel names ending in:

  • win_amd64.whl are for 64-bit versions of ms-windows, and
  • win32.whl are for 32-bit.