Skip to content

Commit 8dbf5ba

Browse files
updated the installation page with tab based navigation (#608)
* [skip actions][skip azp][skip cirrus] updated the installation page with tab based navigation * [skip actions][skip azp][skip cirrus] changed the custom tab based installation navigation to the themes built-in shortcode for tabs * [skip actions][skip azp][skip cirrus] removed hyperlinks, moved types-stubs from the tab-based navigation * [skip actions][skip azp][skip cirrus] moved the See next steps out of the tabs component * style nit * [skip actions][skip azp][skip cirrus] corrected the hyperlinks * Update install.md * lint --------- Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
1 parent 82897c9 commit 8dbf5ba

File tree

1 file changed

+91
-55
lines changed

1 file changed

+91
-55
lines changed

content/en/install.md

Lines changed: 91 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ The recommended method of installing SciPy depends on your preferred workflow.
1414
The common workflows can roughly be broken down into the following
1515
categories:
1616

17-
- [Project-based (e.g. `uv`, `pixi`)](#project-based) (recommended for new users)
18-
- [Environment-based (e.g. `pip`, `conda`)](#environment-based) (the traditional workflow)
19-
- [System package managers](#system-package-managers) (not recommended)
20-
- [Building from source](#building-from-source) (for debugging and development)
17+
- **Project-based** (e.g. `uv`, `pixi`) _(recommended for new users)_
18+
- **Environment-based** (e.g. `pip`, `conda`) _(the traditional workflow)_
19+
- **System package managers** _(not recommended)_
20+
- **Building from source** _(for debugging and development)_
2121

2222
To install SciPy with [static type stubs],
2323
see [Installing with type stubs](#type-stubs).
@@ -29,52 +29,56 @@ Installing type stubs may be required for
2929
Interactive Development Environments (IDEs) to provide accurate type hints.
3030
{{< /admonition >}}
3131

32-
<a name="project-based"></a>
33-
34-
## Project-based workflows
35-
36-
### Installing with `uv`
32+
{{< tabs >}}
3733

38-
Here is a step-by-step guide to setting up a project to use SciPy, with [`uv`],
39-
a Python package manager.
40-
41-
[`uv`]: https://docs.astral.sh/uv/
34+
[[tab]]
35+
name = 'Project Based'
36+
content = '''
37+
<a name="project-based"></a>
4238

43-
<!-- prettier-ignore-start -->
39+
### Installing with uv
4440

45-
1. Install `uv`, following [the instructions in the `uv` documentation][install-uv].
41+
Here is a step-by-step guide to setting up a project to use SciPy, with uv, a Python package manager.
4642

47-
[install-uv]: https://docs.astral.sh/uv/getting-started/installation/
43+
1. Install `uv` following, [the instructions in the uv documentation](https://docs.astral.sh/uv/getting-started/installation/).
4844

49-
2. Create a new project in a new subdirectory, by executing the following in a terminal:
45+
2. Create a new project in a new subdirectory, by executing the following in a terminal:
5046

51-
uv init try-scipy
52-
cd try-scipy
47+
```bash
48+
uv init try-scipy
49+
cd try-scipy
50+
```
5351

54-
{{< admonition hint >}}
52+
{{< admonition hint >}}
5553
The second command changes directory into the directory of your project.
56-
{{< /admonition >}}
54+
{{< /admonition >}}
5755

58-
3. Add SciPy to your project:
56+
3. Add SciPy to your project:
5957

60-
uv add scipy
58+
```bash
59+
uv add scipy
60+
```
6161

62-
{{< admonition note >}}
62+
{{< admonition note >}}
6363
This will automatically install Python if you don't already have it installed!
64-
{{< /admonition >}}
64+
{{< /admonition >}}
6565

66-
{{< admonition tip >}}
66+
{{< admonition tip >}}
6767
You can install other Python libraries in the same way, e.g.
6868

69-
uv add matplotlib
69+
```bash
70+
uv add matplotlib
71+
```
7072

71-
{{< /admonition >}}
73+
{{< /admonition >}}
7274

73-
4. Try out SciPy!
75+
4. Try out SciPy!
7476

75-
uv run python
77+
```bash
78+
uv run python
79+
```
7680

77-
This will launch a Python interpreter session, from which you can `import scipy`.
81+
This will launch a Python interpreter session, from which you can `import scipy`.
7882

7983
<!-- prettier-ignore-end -->
8084

@@ -117,23 +121,30 @@ tool [`pixi`] are very similar to the steps for `uv`:
117121

118122
2. Create a new project in a new subdirectory:
119123

120-
pixi init try-scipy
121-
cd try-scipy
124+
```bash
125+
pixi init try-scipy
126+
cd try-scipy
127+
```
122128

123129
3. Add SciPy to your project:
124130

125-
pixi add scipy
131+
```bash
132+
pixi add scipy
133+
```
126134

127-
4. Try out SciPy!
135+
4. Try out SciPy!
128136

129-
pixi run python
137+
```bash
138+
pixi run python
139+
```
130140

131-
See next steps in [the SciPy user guide][scipy-user-guide].
141+
'''
132142

143+
[[tab]]
144+
name = 'Environment Based'
145+
content = '''
133146
<a name="environment-based"></a>
134147

135-
## Environment-based workflows
136-
137148
In project-based workflows, a project is a directory containing a manifest
138149
file describing the project, a lock-file describing the exact dependencies
139150
of the project, and the project's (potentially multiple) environments.
@@ -152,14 +163,15 @@ but lack some reproducibility benefits of project-based workflows.
152163

153164
2. Create and activate a virtual environment with `venv`.
154165

155-
{{< admonition hint >}}
166+
{{< admonition hint >}}
156167
See [the tutorial in the Python Packaging User Guide](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-virtual-environments).
157-
{{< /admonition >}}
168+
{{< /admonition >}}
158169

159170
3. Install SciPy, using [`pip`]:
160171

161-
python -m pip install scipy
162-
172+
```bash
173+
python -m pip install scipy
174+
```
163175
<!-- prettier-ignore-end -->
164176

165177
[`pip`]: https://pip.pypa.io/en/stable/getting-started/
@@ -170,12 +182,19 @@ See [the tutorial in the Python Packaging User Guide](https://packaging.python.o
170182
two Conda-based environment managers.
171183
After creating an environment, you can install SciPy from conda-forge as follows:
172184

173-
conda install scipy # or
174-
mamba install scipy
185+
```bash
186+
conda install scipy # or
187+
mamba install scipy
188+
```
175189

176190
[Miniforge]: https://conda-forge.org/download/
191+
177192
[`mamba`]: https://mamba.readthedocs.io/en/latest/
193+
'''
178194

195+
[[tab]]
196+
name = 'Package Manager'
197+
content = '''
179198
<a name="system-package-managers"></a>
180199

181200
## Installing system-wide via a system package manager
@@ -189,24 +208,33 @@ installation method.
189208

190209
Using `apt-get`:
191210

192-
sudo apt-get install python3-scipy
211+
```bash
212+
sudo apt-get install python3-scipy
213+
```
193214

194215
### Fedora
195216

196217
Using `dnf`:
197218

198-
sudo dnf install python3-scipy
219+
```bash
220+
sudo dnf install python3-scipy
221+
```
199222

200223
### macOS
201224

202225
macOS doesn't have a preinstalled package manager, but you can install
203226
[Homebrew](https://brew.sh/) and use it to install SciPy (and Python itself):
204227

205-
brew install scipy
228+
```bash
229+
brew install scipy
230+
```
206231

207-
<a name="building-from-source"></a>
232+
'''
208233

209-
## Building from source
234+
[[tab]]
235+
name = 'Building from Source'
236+
content = '''
237+
<a name="building-from-source"></a>
210238

211239
A word of warning: building SciPy from source can be a nontrivial exercise. We
212240
recommend using binaries instead if those are available for your platform
@@ -216,9 +244,15 @@ For details on how to build from source, see
216244

217245
[building-docs]: https://scipy.github.io/devdocs/building/index.html
218246

247+
'''
248+
249+
{{</ tabs >}}
250+
251+
See next steps in the [SciPy user guide](https://docs.scipy.org/doc/scipy/tutorial/).
252+
219253
<a name="type-stubs"></a>
220254

221-
## Installing with type stubs
255+
## Installing with Type Stubs
222256

223257
Static type stubs are available via a separate package, `scipy-stubs`, on
224258
PyPI and conda-forge.
@@ -228,10 +262,12 @@ package on conda-forge.
228262
To get a specific version `x.y.z` of SciPy (such as `1.14.1`),
229263
you should install version `x.y.z.*`, for example:
230264

231-
uv add "scipy-stubs[scipy]==1.14.1.*" # or
232-
pixi add "scipy-typed=1.15.0.*" # or
233-
python -m pip install "scipy-stubs[scipy]" # or
234-
conda install "scipy-typed>=1.14"
265+
```bash
266+
uv add "scipy-stubs[scipy]==1.14.1.*" # or
267+
pixi add "scipy-typed=1.15.0.*" # or
268+
python -m pip install "scipy-stubs[scipy]" # or
269+
conda install "scipy-typed>=1.14"
270+
```
235271

236272
Please direct questions about static typing support to
237273
[the `scipy-stubs` GitHub repository](https://github.com/jorenham/scipy-stubs).

0 commit comments

Comments
 (0)