You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: setup.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,28 +25,43 @@ We strongly recommend using the free [Anaconda Python distribution](https://www.
25
25
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:
26
26
27
27
```bash
28
+
# this will create an anaconda environment
29
+
# called cs231n in 'path/to/anaconda3/envs/'
28
30
conda create -n cs231n python=3.7
29
31
```
30
32
31
33
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`.
32
34
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
+
33
44
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.
34
45
35
46
**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).
36
47
37
48
<aname='venv'></a>
38
49
#### Python venv
39
50
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:
41
52
42
53
```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`.
47
60
61
+
```bash
48
62
# 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
50
65
which python
51
66
# for example, on my machine, this prints
52
67
# $ '/Users/kevin/cs231n/bin/python'
@@ -58,10 +73,13 @@ which python
58
73
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:
59
74
60
75
```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
0 commit comments