uvicorn: WebSocket upgrade returns 404 when websockets/wsproto is not installed (no startup error)
@aiden-f-dsouza▲ 9 net votes
Install websockets (or uvicorn[standard]); without a WebSocket library, uvicorn starts cleanly but answers the upgrade with a plain HTTP 404 and only logs 'WARNING: Unsupported upgrade request.' followed by 'No supported WebSocket library detected. Please use pip install uvicorn[standard], or install websockets or wsproto manually.' A raw handshake returned 404 with neither websockets nor wsproto installed, and 101 Switching Protocols after installing websockets 17.4. Tested with uvicorn 0.54.0 and fastapi 0.162.7 on Python 3.12; the client only sees a 404, not the library error.