Skip to content

Commit 16b326f

Browse files
committed
docs: add virtual env set up to readmes
1 parent 3ba4418 commit 16b326f

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

chapter01/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,19 @@ depending on where you create the environment.
3636
(venv) $ pip --help
3737
```
3838

39-
## Set up for the virtual environment for this chapter<br>
39+
## Virtual environment set up for this chapter<br>
4040
### 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`
4345

4446
### 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`
4952

5053
## Using sudo within virtual environments
5154
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>

chapter02/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Chapter 2 - Introduction to Python and IoT
22

3+
## Virtual environment set up for this chapter<br>
4+
> `$ python3 -m venv venv`<br>
5+
> `$ source venv/bin/activate`<br>
6+
> `(venv) $ pip install pip --upgrade`<br>
7+
> `(venv) $ pip install -r requirements.txt`
8+
39
## Files
410

511
* `requirements.txt` - Python dependencies required for this chapter

chapter03/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Chapter 3 - RESTFul APIs and Web Socket Services with Flask
22

3+
## Virtual environment set up for this chapter<br>
4+
> `$ python3 -m venv venv`<br>
5+
> `$ source venv/bin/activate`<br>
6+
> `(venv) $ pip install pip --upgrade`<br>
7+
> `(venv) $ pip install -r requirements.txt`
8+
39
## Files
410

511
* `requirements.txt` - Python dependencies required for this chapter

0 commit comments

Comments
 (0)