In my case, I was using the Docker method for the AWS CLI tool, and I hadn't read the instructions far enough to realize that I had to make my credentials directory visible to the docker container. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-docker.html
Instead of
docker run --rm -it amazon/aws-cli:latest command args...
I needed to do:
docker run --rm -it -v ~/.aws:/root/.aws amazon/aws-cli:latest command args...