diff --git a/README.md b/README.md index 66232d9..1f09d99 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,24 @@ Any other mix works — it is all in `config.py`. ## Install ```bash -pip3 install -r requirements.txt +cd /home/pi/heos +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt python3 app.py ``` Then open `http://:5005/`. +The virtual environment is not optional on a current Raspberry Pi OS: +`pip install` straight into the system Python is refused there with +`externally-managed-environment`. It also keeps Flask out of the way of +anything else running on the Pi. + +Every later `python3 ...` command here assumes the environment is active +(`source .venv/bin/activate`); `deactivate` when you are done. The service +below calls the environment's Python directly, so it does not care. + ## Configure Open `http://:5005/api/targets` and copy the exact `name` HEOS reports @@ -70,7 +82,7 @@ Description=HEOS panel After=network-online.target [Service] -ExecStart=/usr/bin/python3 /home/pi/heos/app.py +ExecStart=/home/pi/heos/.venv/bin/python /home/pi/heos/app.py WorkingDirectory=/home/pi/heos Restart=always User=pi