Skip to content

Commit 2a78efc

Browse files
committed
Add instructions for creating virtual environment
1 parent ec30ac5 commit 2a78efc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

_labs/chat-client.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ If no name is provided, then use NETID as the name.
132132

133133
- Show when people have left or joined the chat server. This can be inline with the chat messages.
134134

135+
## Installing Python Libraries
136+
To install the Paho MQTT Client library and Textual library, you will need to create a [virtual environment](https://docs.python.org/3/library/venv.html). A virtual environment allows you to install Python libraries without needing administrator privileges and without interfering with other Python projects you might have on your computer.
137+
138+
Here is how you do it:
139+
140+
```bash
141+
cd path/to/your/project/folder
142+
python3 -m venv .venv # Create a virtual environment in the .venv folder
143+
source .venv/bin/activate # Activate the virtual environment
144+
pip install paho-mqtt textual # Install the required libraries
145+
```
146+
147+
Every time you want to work on your project, you will need to activate the virtual environment by running `source .venv/bin/activate` in your project folder.
148+
135149
## Testing
136150

137151
The chat server will be hosted at lundrigan.byu.edu:1883.

0 commit comments

Comments
 (0)