Easy Tutorial
❮ Scipy Sparse Matrix Scipy Spatial Data ❯

SciPy Installation

In this section, we will use the pip tool to install the SciPy library. If you haven't installed this tool yet, you can refer to Python pip Installation and Usage.

Upgrade pip:

python3 -m pip install -U pip

Install the scipy library:

python3 -m pip install -U scipy

After installation, we can import the scipy library using from scipy import module:

constants is the constants module in scipy.

from scipy import constants

The following example demonstrates how to import the scipy library and check its version number:

Example

import scipy

print(scipy.__version__)

Executing the above code will produce the following output:

1.7.0

In the following example, we import the constants module from scipy to find out how many square meters are in an acre:

Example

from scipy import constants

# How many square meters are in an acre
print(constants.acre)

Executing the above code will produce the following output:

4046.8564223999992
❮ Scipy Sparse Matrix Scipy Spatial Data ❯