Python Programming With Microsoft Visual Studio Code For Mac

See under Extra in the Visual Studio (Extra-Python-Interactive Window). It has the ability to switch the interactive console through a different platform/Python version (32-bit, 64-bit, Debug, and Anaconda (which has the NumPy package)). Python in Visual Studio Code. Working with Python in Visual Studio Code, using the Microsoft Python extension, is simple, fun, and productive.The extension makes VS Code an excellent IDE, and works on any operating system with a variety of Python interpreters.

Active1 year, 1 month ago

I downloaded http://pytools.codeplex.com/ (Python Tools for Visual Studio) so that I could write Python in Visual Studio.

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

Programming with microsoft visual basic 2017Studio

It says 'No module named 'numpy'.'

How can I use NumPy and SciPy in Visual Studio?

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

I added the Python 3.3 environment to my Python 'solution' by right-clicking Python environments and clicking add an 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:

How can I install NumPy?

user1477388user1477388
13.8k21 gold badges106 silver badges206 bronze badges

7 Answers

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.

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
Roland SmithRoland Smith
29.1k3 gold badges36 silver badges61 bronze badges

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':

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
DanielDaniel

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.
Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
KyleKyle

I actually ran into the same set of problems when trying to use Visual Studio for Python.

I managed to get things to work at the end - please see Using Visual Studio 2013 for Python (3.4) with NumPy and SciPy on Windows for details. Essentially you can either use the installer (if one is available) or use pip to do the installation.

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
ThusiThusi

Make sure C++ Common Tools are installed in Visual Studio:

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
BohdanBohdan

See under Extra in the Visual Studio (Extra-Python-Interactive Window).

It has the ability to switch the interactive console through a different platform/Python version (32-bit, 64-bit, Debug, and Anaconda (which has the NumPy package)).

Peter Mortensen
14.4k19 gold badges88 silver badges117 bronze badges
omedahunsiomedahunsi

From PTVS Installation:

2. Installing packages individually

Here are some recommended packages. Generally you want to install packages using pip or through the interface in Visual Studio (which uses pip), as this will ensure that you get the latest version that will work with your version of Python, as well as any dependencies.

Some packages have complex dependencies and need to be downloaded manually, either from the project's website or from Christoph Gohlke's package collection.

I installed numpy and scipy from these links, and it works perfectly with Visual Studio.

  • numpyhttp://sourceforge.net/projects/numpy/files/NumPy/
  • scipyhttp://sourceforge.net/projects/scipy/files/scipy/
  • Matplotlibhttp://matplotlib.org/downloads.html
  • Pandashttp://pandas.pydata.org/getpandas.html
Peter Mortensen

Microsoft Visual Studio Download

14.4k19 gold badges88 silver badges117 bronze badges
Charles ClaytonCharles Clayton

Programming With Microsoft Visual Basic 2012 Sixth Edition Diane Zak

8,5788 gold badges59 silver badges91 bronze badges

Microsoft Visual Studio Express

Not the answer you're looking for? Browse other questions tagged pythonvisual-studionumpypip or ask your own question.