Application Qt (PySide6) avec un point d'entree simple dans widget.py.
- Ubuntu/WSL
- Python 3.12+
- pip
- Dependance systeme Qt (xcb):
sudo apt update
sudo apt install -y libxcb-cursor0- Dependance systeme GStreamer (necessaire pour
RTSPView/ RTSP):
sudo apt update
sudo apt install -y \
python3-gi gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 \
gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-libav \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-badDepuis le dossier du projet:
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r requirements.txtNote: si tu utilises python3-gi installe via apt, un venv standard ne le voit pas.
Dans ce cas, recree le venv avec:
python3 -m venv --system-site-packages .venvUtiliser le script fourni:
./run.shLe script:
- nettoie les variables Qt qui peuvent casser le chargement des plugins,
- utilise Wayland via WSLg si disponible,
- retombe sur xcb/X11 sinon.
env -u QT_PLUGIN_PATH -u QT_QPA_PLATFORM_PLUGIN_PATH -u LD_LIBRARY_PATH \
XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir \
WAYLAND_DISPLAY=wayland-0 \
QT_QPA_PLATFORM=wayland \
.venv/bin/python widget.pyenv -u QT_PLUGIN_PATH -u QT_QPA_PLATFORM_PLUGIN_PATH -u LD_LIBRARY_PATH \
DISPLAY=:0 \
QT_QPA_PLATFORM=xcb \
.venv/bin/python widget.py- Verifier l'affichage WSLg:
echo $WAYLAND_DISPLAY
echo $DISPLAY- Verifier le socket Wayland WSLg:
ls -la /mnt/wslg/runtime-dir/wayland-0- Si besoin, redemarrer WSL depuis Windows PowerShell:
wsl --shutdown
wslLa webcam est souvent plus simple à tester en natif Windows (WSL ne voit pas toujours /dev/video*).
- Python 3.12+ sur Windows
Dans un PowerShell (dans le dossier capraui qui contient widget.py) :
python -m venv .venv
.venv\Scripts\activate
./build_windows.ps1 -Mode onedirLe binaire est dans dist\capraui\.
Alternative CMD:
python -m venv .venv
.venv\Scripts\activate
build_windows.cmd