Skip to content

Light edits to the setup section #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions content/contributors/setup/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ itself installed. There are two, largely equivalent, ways of doing
that, and we describe both below.

If you have a working version of Python on your system already (check
by running `python3`), you can skip to setting up a virtual environment.
by running `python` at the terminal), you can skip to "Segment 1: Set up a virtual environment".

## Segment 1: Python.org

Expand All @@ -20,23 +20,16 @@ Download the installer from https://www.python.org/downloads/.
A virtual environment is a workspace into which you can install Python
libraries, separate from what is being used by your operating system.

Create a new virtual environment in a directory called
`py3`:
Here, we create a new virtual environment in a directory `science` (you can use whichever name you prefer!):

```
python -m venv py3
python -m venv science
```

Start using it as follows:
Start using it by activating it as follows:

```
source py3/bin/activate
```

Also, make sure you have `pip` installed---that is Python's default package manager:

```
python -m ensurepip
source science/bin/activate
```

You are now ready to install Scientific Python packages using `pip`! For example:
Expand All @@ -56,6 +49,12 @@ In [2]: np.linspace(0, 10, 5)
Out[2]: array([ 0. , 2.5, 5. , 7.5, 10. ])
```

Remember to re-activate your environment every time you open a new terminal, using:

```
source science/bin/activate
```

## Segment 2: Miniforge

Miniforge is a small Python distribution based around the conda
Expand Down Expand Up @@ -112,3 +111,9 @@ In [1]: import numpy as np
In [2]: np.linspace(0, 10, 5)
Out[2]: array([ 0. , 2.5, 5. , 7.5, 10. ])
```

Remember to re-activate your environment every time you open a new terminal:

```
conda activate science
```