Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SciPy Installation

SciPy Installation

In this section, we use the pip tool to install the SciPy library. If the tool is not yet installed, 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 SciPy's library via from scipy import module:

constants is SciPy's constants module.

from

scipy

import

constants

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

Example

import

scipy

print

(

scipy.version

)

After executing the above code, the output is as follows:

1.7.0

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

Example

from

scipy

import

constants

How many square meters are in an acre

print

(

constants.

acre

)

After executing the above code, the output is as follows:

4046.8564223999992