Skip to content

Commit e35e1ef

Browse files
committed
better language in setup instructions
1 parent 235e0b2 commit e35e1ef

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

setup.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,43 @@ We strongly recommend using the free [Anaconda Python distribution](https://www.
2525
Once you have Anaconda installed, it makes sense to create a virtual environment for the course. If you choose not to use a virtual environment (strongly not recommended!), it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment called `cs231n`, run the following in your terminal:
2626

2727
```bash
28+
# this will create an anaconda environment
29+
# called cs231n in 'path/to/anaconda3/envs/'
2830
conda create -n cs231n python=3.7
2931
```
3032

3133
To activate and enter the environment, run `conda activate cs231n`. To deactivate the environment, either run `conda deactivate cs231n` or exit the terminal. Note that every time you want to work on the assignment, you should rerun `conda activate cs231n`.
3234

35+
```bash
36+
# sanity check that the path to the python
37+
# binary matches that of the anaconda env
38+
# after you activate it
39+
which python
40+
# for example, on my machine, this prints
41+
# $ '/Users/kevin/anaconda3/envs/sci/bin/python'
42+
```
43+
3344
You may refer to [this page](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for more detailed instructions on managing virtual environments with Anaconda.
3445

3546
**Note:** If you've chosen to go the Anaconda route, you can safely skip the next section and move straight to [Installing Packages](#installing-packages).
3647

3748
<a name='venv'></a>
3849
#### Python venv
3950

40-
As of 3.3, Python natively ships with a lightweight virtual environment module called [venv](https://docs.python.org/3/library/venv.html). Each virtual environment packages its own independent set of installed Python packages that are isolated from system-wide Python packages and runs a Python version that matches that of the binary that was used to create it. To set up your `cs231` venv for the course, run the following:
51+
As of 3.3, Python natively ships with a lightweight virtual environment module called [venv](https://docs.python.org/3/library/venv.html). Each virtual environment packages its own independent set of installed Python packages that are isolated from system-wide Python packages and runs a Python version that matches that of the binary that was used to create it. To set up a virtual environment called `cs231n`, run the following in your terminal:
4152

4253
```bash
43-
# create a virtual environment called cs231n
44-
# that will use version 3.7 of Python
45-
python3.7 -m venv cs231n
46-
source cs231n/bin/activate # activate the virtual env
54+
# this will create a virtual environment
55+
# called cs231n in your home directory
56+
python3.7 -m venv ~/cs231n
57+
```
58+
59+
To activate and enter the environment, run `source ~/cs231n/bin/activate`. To deactivate the environment, either run `deactivate` or exit the terminal. Note that every time you want to work on the assignment, you should rerun `source ~/cs231n/bin/activate`.
4760

61+
```bash
4862
# sanity check that the path to the python
49-
# binary matches that of the virtual env.
63+
# binary matches that of the virtual env
64+
# after you activate it
5065
which python
5166
# for example, on my machine, this prints
5267
# $ '/Users/kevin/cs231n/bin/python'
@@ -58,10 +73,13 @@ which python
5873
Once you've **setup** and **activated** your virtual environment (via `conda` or `venv`), you should install the libraries needed to run the assignments using `pip`. To do so, run:
5974

6075
```bash
61-
# again, ensure your virtual env has been activated
62-
# before running the commands below
76+
# again, ensure your virtual env (either conda or venv)
77+
# has been activated before running the commands below
6378
cd assignment1 # cd to the assignment directory
64-
pip install -r requirements.txt # install assignment dependencies
65-
# work on the assignment for a while ...
66-
deactivate # deactivate the virtual env
79+
80+
# install assignment dependencies.
81+
# since the virtual env is activated,
82+
# this pip is associated with the
83+
# python binary of the environment
84+
pip install -r requirements.txt
6785
```

0 commit comments

Comments
 (0)