How to install SciPy with a system package manager

System package managers can provide SciPy for scripts that must use the operating system's Python or a host-managed scientific stack. This path fits shared hosts, distro-packaged applications, and policy-controlled servers where the package database should own compiled numerical libraries.

The current SciPy install page treats system package managers as a system-wide workflow and notes that they can lag behind project or environment installs. For new project work, a venv, uv, or Conda environment usually gives tighter dependency control; use the system package when matching the host package policy matters more than getting the newest SciPy release.

APT uses the python3-scipy package on Ubuntu and Debian, DNF uses the same package name on Fedora, and Homebrew installs the scipy formula for its managed Python. Check both the package database and a small SciPy calculation, because a successful package transaction alone does not prove the intended interpreter can import the module.

Steps to install SciPy with a system package manager:

  1. Open a terminal with package-manager privileges.

    Use sudo for APT or DNF on Linux. Use a shell where Homebrew is already on PATH for macOS.

  2. Refresh the APT package index on Ubuntu or Debian.
    $ sudo apt-get update
  3. Install the SciPy system package on Ubuntu or Debian.
    $ sudo apt-get install --assume-yes python3-scipy
    Reading package lists... Done
    Building dependency tree... Done
    The following NEW packages will be installed:
      python3-scipy
    ##### snipped #####
    Setting up python3-scipy (1.16.3-4build1) ...

    Package versions and dependency lists vary by release. On Fedora, use sudo dnf install python3-scipy. On macOS with Homebrew, use brew install scipy.

  4. Confirm the APT package record.
    $ dpkg-query -W python3-scipy
    python3-scipy	1.16.3-4build1

    On Fedora, use dnf list installed python3-scipy. On macOS with Homebrew, use brew list --versions scipy.

  5. Run a SciPy import and linear-algebra smoke test.
    $ python3 -c "from scipy import linalg; print(linalg.det(((1, 2), (3, 4))))"
    -2.0

    The determinant of ((1, 2), (3, 4)) is -2.0. If the import fails, confirm that python3 is the interpreter managed by the package manager that installed SciPy.