docs: clarify Python deps use apt packages not pip/venv
Dev server uses apt-managed python3-pandas and python3-openpyxl. Production fix is the same. Updates README install step and rewrites python-venv-setup.md to reflect the real setup with venv as fallback.
This commit is contained in:
23
README.md
23
README.md
@@ -68,7 +68,7 @@ The application provides:
|
||||
|
||||
- Node.js 18 or later
|
||||
- npm
|
||||
- Python 3 with a venv containing `pandas` and `openpyxl` (required for compliance xlsx parsing)
|
||||
- Python 3 with `python3-pandas` and `python3-openpyxl` apt packages (required for compliance xlsx parsing)
|
||||
|
||||
---
|
||||
|
||||
@@ -97,28 +97,13 @@ npm install
|
||||
|
||||
### 4. Install Python dependencies
|
||||
|
||||
Modern Debian/Ubuntu systems enforce PEP 668 and block system-wide pip installs. Create a virtual environment instead:
|
||||
Install via apt — this is the correct approach on Ubuntu/Debian and mirrors the dev server setup:
|
||||
|
||||
```bash
|
||||
# Install venv support if needed
|
||||
apt install -y python3-venv python3-full
|
||||
|
||||
# Create the venv (once per server, from the app root)
|
||||
python3 -m venv /home/cve-dashboard/venv
|
||||
|
||||
# Install packages into the venv
|
||||
/home/cve-dashboard/venv/bin/pip install -r backend/scripts/requirements.txt
|
||||
apt install -y python3-pandas python3-openpyxl
|
||||
```
|
||||
|
||||
Required packages: `pandas>=2.0.0`, `openpyxl>=3.0.0`
|
||||
|
||||
Then set the `PYTHON_BIN` environment variable so the backend uses the venv Python:
|
||||
|
||||
```bash
|
||||
export PYTHON_BIN=/home/cve-dashboard/venv/bin/python3
|
||||
```
|
||||
|
||||
Add this to the server's startup environment (e.g., your systemd unit or `.env` file) so it persists across restarts. If `PYTHON_BIN` is not set, the backend falls back to the system `python3`.
|
||||
> If apt packages are unavailable or you need a specific version, see `docs/python-venv-setup.md` for the venv fallback approach.
|
||||
|
||||
> The bulk notes import script (`import_notes_from_csv.py`) uses only Python stdlib and does **not** require these packages.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user