I get a similar error if I run docker-compose. But I don't get that error if I run docker compose instead (without a dash).
docker compose is a newer tool, it's part of Docker. It's written in Go like the rest of Docker. docker-compose is an older tool written in Python.