NumPy Environment Setup

NumPy doesn't come bundled with Python. We have to install it using the python pip installer. Execute the following command.

snippet
$ pip install numpy

It is best practice to install NumPy with the full SciPy stack. The binary distribution of the SciPy stack is specific to the operating systems.

Windows

On the Windows operating system, The SciPy stack is provided by the Anaconda which is a free distribution of the Python SciPy package.

It can be downloaded from the official website: https://www.anaconda.com/. It is also available for Linux and Mac.

The CanoPy also comes with the full SciPy stack which is available as free as well as commercial license. We can download it by visiting the link: https://www.enthought.com/products/canopy/

The Python (x, y) is also available free with the full SciPy distribution. Download it by visiting the link: https://python-xy.github.io/

Linux

In Linux, the different package managers are used to install the SciPy stack. The package managers are specific to the different distributions of Linux. Let's look at each one of them.

Ubuntu

Execute the following command on the terminal.

snippet
$ sudo apt-get install python-numpy

$ python-scipy python-matplotlibipythonipythonnotebook python-pandas

$ python-sympy python-nose

Redhat

On Redhat, the following commands are executed to install the Python SciPy package stack.

snippet
$ sudo yum install numpyscipy python-matplotlibipython 

$ python-pandas sympy python-nose atlas-devel

To verify the installation, open the Python prompt by executing python command on the terminal (cmd in the case of windows) and try to import the module NumPy as shown in the below image. If it doesn't give the error, then it is installed successfully.

NumPy Environment Setup
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +