SciPy Installation

In this chapter, we use the pip tool to install the SciPy library. If you have not installed this tool yet, you can refer toPython 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 usefrom scipy import moduleto import the scipy library:

constants is the constants module of scipy.

from scipy import constants

In the following example, we import the scipy library and then check the version number of the scipy library:

Example

import scipy

print(scipy.__version__)

Executing the above code, the output result is as follows:

1.7.0

In the following example, we import scipy's constants module to see how many square meters an acre equals:

Example

from scipy import constants

# How many square meters is one acre?
print(constants.acre)

Executing the above code, the output result is as follows:

4046.8564223999992
Other Extensions