This page assumes that you are comfortable with using a terminal and happy to learn how to use a package manager. If you are a beginner and just want to get started with SciPy as quickly as possible, check out the beginner installation guide!
The recommended method of installing SciPy depends on your preferred workflow. The common workflows can roughly be broken down into the following categories:
uv
, pixi
) (recommended for new users)pip
, conda
) (the traditional workflow)To install SciPy with static type stubs, see Installing with type stubs.
uv
#Here is a step-by-step guide to setting up a project to use SciPy, with uv
,
a Python package manager.
uv
, following the instructions in the uv
documentation.Create a new project in a new subdirectory, by executing the following in a terminal:
uv init try-scipy
cd try-scipy
The second command changes directory into the directory of your project.
Add SciPy to your project:
uv add scipy
This will automatically install Python if you don’t already have it installed!
You can install other Python libraries in the same way, e.g.
uv add matplotlib
Try out SciPy!
uv run python
This will launch a Python interpreter session, from which you can import scipy
.
See next steps in the SciPy user guide.
After rebooting your computer, you’ll want to navigate to your try-scipy
project directory and execute uv run python
to drop back into a Python interpreter
with SciPy importable.
To execute a Python script, you can use uv run myscript.py
.
Read more at the uv guide to working on projects.
pixi
#If you work with non-Python packages, you may prefer to install SciPy as a Conda package, so that you can use the same workflow for packages which are not available on PyPI, the Python Package Index. Conda can manage packages in any language, so you can use it to install Python itself, compilers, and other languages.
The steps to install SciPy from conda-forge using the package management
tool pixi
are very similar to the steps for uv
:
pixi
, following the instructions in the pixi
documentation.Create a new project in a new subdirectory:
pixi init try-scipy
cd try-scipy
Add SciPy to your project:
pixi add scipy
Try out SciPy!
pixi run python
See next steps in the SciPy user guide.
In project-based workflows, a project is a directory containing a manifest file describing the project, a lock-file describing the exact dependencies of the project, and the project’s (potentially multiple) environments.
In contrast, in environment-based workflows you install packages into an environment, which you can activate and deactivate from any directory. These workflows are well-established, but lack some reproducibility benefits of project-based workflows.
pip
#Create and activate a virtual environment with venv
.
Install SciPy, using pip
:
python -m pip install scipy
conda
#Miniforge is the recommended way to install conda
and mamba
,
two Conda-based environment managers.
After creating an environment, you can install SciPy from conda-forge as follows:
conda install scipy # or
mamba install scipy
System package managers can install the most common Python packages. They install packages for the entire computer, often use older versions, and don’t have as many available versions. They are not the recommended installation method.
Using apt-get
:
sudo apt-get install python3-scipy
Using dnf
:
sudo dnf install python3-scipy
macOS doesn’t have a preinstalled package manager, but you can install Homebrew and use it to install SciPy (and Python itself):
brew install scipy
A word of warning: building SciPy from source can be a nontrivial exercise. We recommend using binaries instead if those are available for your platform via one of the above methods. For details on how to build from source, see the building from source guide in the SciPy docs.
Static type stubs are available via a separate package, scipy-stubs
, on
PyPI and conda-forge.
You can also install SciPy and scipy-stubs
as a single package,
via the scipy-stubs[scipy]
extra on PyPI, or the scipy-typed
package on conda-forge.
To get a specific version x.y.z
of SciPy (such as 1.14.1
),
you should install version x.y.z.*
, for example:
uv add "scipy-stubs[scipy]==1.14.1.*" # or
pixi add "scipy-typed=1.15.0.*" # or
python -m pip install "scipy-stubs[scipy]" # or
conda install "scipy-typed>=1.14"
Please direct questions about static typing support to
the scipy-stubs
GitHub repository.