user1477388 user1477388 - 10 months ago 139
Python Question

Using NumPy in Visual Studio

I downloaded (Python Tools for Visual Studio) so that I could write Python in VS, of course!

The problem is, when I try to use the most basic package "numpy" like so:

import numpy

It says "No module named 'numpy'."

How can I use numpy and scipy in Visual Studio?

Note: I am using this Canopy Express on another machine which works perfectly; however, I don't want to install it on this machine since I already have VS installed.


I added the python 3.3 environment to my python "solution" by right-clicking python environments and clicking add environment. But, after right-clicking my environment and clicking install python package, I typed in "numpy" and got this error when trying to install it:

creating build
creating build\src.win32-3.3
creating build\src.win32-3.3\numpy
creating build\src.win32-3.3\numpy\distutils
building library "npymath" sources
No module named 'numpy.distutils.msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat
Cleaning up...
Command python egg_info failed with error code 1 in c:\users\dom\appdata\local\temp\pip_build_Dom\numpy
Storing complete log in C:\Users\Dom\pip\pip.log
'numpy' failed to install. Exit code: 1

How can I install numpy?

Answer Source

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.