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: chapter01/README.md
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -36,16 +36,19 @@ depending on where you create the environment.
36
36
(venv) $ pip --help
37
37
```
38
38
39
-
## Set up for the virtual environment for this chapter<br>
39
+
## Virtual environment set up for this chapter<br>
40
40
### Option 1
41
-
1.`$ source venv/bin/activate`
42
-
2.`(venv) $pip install -r requirements.txt`
41
+
1.`$ python3 -m venv venv`
42
+
2.`$ source venv/bin/activate`
43
+
3.`(venv) $ pip install pip --upgrade`
44
+
4.`(venv) $pip install -r requirements.txt`
43
45
44
46
### Option 2
45
-
1.`$ source venv/bin/activate`
46
-
2.`(venv) $ pip install --upgrade pi`
47
-
3.`(venv) $ pip install gpiozero pigpio`
48
-
4.`(venv) $ pip freeze > requirements.txt`
47
+
1.`$ python3 -m venv venv`
48
+
2.`$ source venv/bin/activate`
49
+
3.`(venv) $ pip install --upgrade pi`
50
+
4.`(venv) $ pip install gpiozero pigpio`
51
+
5.`(venv) $ pip freeze > requirements.txt`
49
52
50
53
## Using sudo within virtual environments
51
54
The `sudo` action will use default Python that's available to the root user. The correct way to run a script is to pass the absolute path using the `which python`command:<br>
0 commit comments