Registry / data / scipy
library1.18.1pypypi✓ verified 24d ago

SciPy is a Python library for scientific computing, offering modules for optimization, integration, interpolation, linear algebra, statistics, and more. The current version is 1.17.1, released on February 22, 2026, with a regular release cadence of approximately every 6 months.

pip install scipy
INSTALL
IMPORT
SIG · SCIPY
S
scipy
datapythonv1.18.1
Install
7.4s avg
Import
1018ms
Disk
230MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.15.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.040s · 230.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.4s · import 0.996s · 222MB
230MB installed
● package 230MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

shortest_path
from scipy.sparse.csgraph import shortest_path
Ensure correct submodule import for shortest_path function.
geometric_slerp
from scipy.spatial import geometric_slerp
Ensure correct submodule import for geometric_slerp function.

This example demonstrates how to compute the shortest path distances in a graph using SciPy's sparse graph module.

import numpy as np from scipy.sparse.csgraph import shortest_path # Create a sample graph as a 2D NumPy array graph = np.array([[0, 1, 2], [1, 0, 0], [2, 0, 0]]) # Compute the shortest path distances dist_matrix, predecessors = shortest_path(graph, return_predecessors=True) print('Shortest path distance matrix:') print(dist_matrix)
Debug
Known issues
breakingSciPy 1.17.1 requires Python 3.11 or higher.
fix
Upgrade your Python installation to version 3.11 or later.
affects: 1.17.1
gotchaEnsure that NumPy is installed before SciPy, as SciPy depends on NumPy for array operations.
fix
Install NumPy first using 'pip install numpy'.
affects: all
Errors
Common errors & fixes
Failed building wheel for scipy
SciPy's installation from source (which pip attempts if no pre-built wheel is available) requires a C/Fortran compiler toolchain on your system.
fix
Ensure you have `numpy` pre-installed and use a compatible Python version for which pre-built wheels exist, or install the necessary compiler tools (e.g., build-essential on Linux, Xcode Command Line Tools on macOS, Visual C++ build tools on Windows). Often, `pip install --upgrade pip` followed by `pip install numpy scipy` resolves it.
Optimal parameters not found: The iteration is not making good progress, as measured by the improvement from the last ten iterations.
The `scipy.optimize.curve_fit` algorithm failed to converge to a stable solution, often due to poor initial guesses, ill-conditioned data, or an unsuitable model function.
fix
Provide better initial guesses for the parameters (`p0`), increase the maximum number of iterations (`maxfev`), or add bounds to the parameters (`bounds`).
AttributeError: module 'scipy' has no attribute 'interp1d'
The `interp1d` function is part of the `scipy.interpolate` submodule, but the code attempted to access it directly from the top-level `scipy` module.
fix
Import `interp1d` from its correct submodule: `from scipy.interpolate import interp1d`.
scipy.linalg.LinAlgError: Singular matrix
This error occurs when a linear algebra operation (like matrix inversion) is performed on a singular matrix, which has a determinant of zero and thus no unique inverse.
fix
Check the input matrix for linear dependencies or near-singularities. If solving a system, consider using a pseudo-inverse (`numpy.linalg.pinv` or `scipy.linalg.pinv`) or least squares (`numpy.linalg.lstsq`) instead of direct inversion.
IntegrationWarning: The integral is probably divergent, or slowly convergent.
The `scipy.integrate.quad` function struggled to evaluate the integral, often indicating a singularity, discontinuity, or highly oscillatory behavior of the integrand within the integration range.
fix
Examine the integrand for singularities or problematic points within the integration interval. If known, specify singular points using the `points` argument in `quad`, split the integral, or adjust error tolerances (`epsabs`, `epsrel`).
Upgrade
Version history
1.18.1latest on PyPI · released Aug 21, 2026
Audit
Dependencies
numpyrequiredSciPy depends on NumPy for array operations and numerical computations.
Agent activity
37 hits · last 30 days
node
32
OpenAI (training)
1
Resources