The config profile could not be found

TL;DR — The profile name you're using doesn't exist in the AWS config files your process is reading. Three usual suspects: a stale AWS_PROFILE environment variable, a typo in --profile/profile_name, or the profile defined under the wrong section header — the ~/.aws/config file needs [profile myprofile], while ~/.aws/credentials uses plain [myprofile]. Run aws configure list-profiles and compare.

What it means

botocore.exceptions.ProfileNotFound: The config profile (myprofile) could not be found

Before any DynamoDB call can be signed, the SDK resolves a credentials profile. If a profile was explicitly requested — via AWS_PROFILE, --profile, or boto3.Session(profile_name=...) — and no section with that name exists in the config/credentials files being read, resolution stops with this error. Nothing reached AWS; it's entirely a local configuration lookup failing.

Why it happens

  • AWS_PROFILE points at a profile that doesn't exist — set in a shell rc file, a container image, or CI config long ago, then the profile was renamed or removed.
  • A typo or case mismatch — profile names are matched exactly.
  • Wrong section-header syntax — in ~/.aws/config a named profile must be declared as [profile myprofile]; writing [myprofile] there means the CLI/SDK can't find it (the plain form belongs in ~/.aws/credentials).
  • The files aren't where the process looksAWS_CONFIG_FILE/AWS_SHARED_CREDENTIALS_FILE overriding the path, a different home directory under sudo/a service user, or a container without the ~/.aws mount.

How to fix it

  1. List what's actually visible to your environment:

    aws configure list-profiles
    env | grep -i '^AWS_'
  2. Fix or unset the pointerunset AWS_PROFILE (or set it to a listed profile), correct the --profile/profile_name spelling.

  3. Check the section headers:

    # ~/.aws/config
    [profile myprofile]
    region = eu-west-1
    
    # ~/.aws/credentials
    [myprofile]
    aws_access_key_id = ...
    aws_secret_access_key = ...
  4. Create the profile if it never existedaws configure --profile myprofile (or aws configure sso for Identity Center profiles).

  5. In containers/CI, prefer environment credentials or a role over profile files — or mount/point AWS_CONFIG_FILE at a file that really defines the profile.

See it in DynoTable

DynoTable reads the same ~/.aws/credentials and ~/.aws/config files as the CLI — add profiles under Settings → Profiles, pick the profile name from the dropdown, and run Test Connection to confirm it resolves before your SDK does. Profile switching (⌘P) makes a stale AWS_PROFILE obvious when tables disappear.

For Local, create a profile with endpoint http://localhost:8000 and dummy credentials. See Connect to AWS and Install. Open tables with ⌘K once connected, then run a smoke-test query in the Query Builder.

Sources

Reproduce it

Point boto3 at a profile that is not in your config, with the AWS environment cleared so nothing else satisfies the lookup:

import boto3
boto3.Session(profile_name='no-such-profile-xyz').client('dynamodb').list_tables()

Real output:

ProfileNotFound: The config profile (no-such-profile-xyz) could not be found

This is raised by botocore on the client, before any request reaches AWS — which is why there is no HTTP status and why retrying cannot help. The name in parentheses is the profile it looked for, so it tells you whether the typo is in your code or in your config file.

References

Last verified 2026-07-13 against the official AWS documentation linked above.

Reproduced 2026-07-26 against boto3 1.43.56 / botocore 1.43.56 — the output above is verbatim.

Work with DynamoDB without the Console

A fast DynamoDB desktop client that runs the real SQL DynamoDB can’t — JOINs, GROUP BY, aggregates — with visual editing and an AI agent on your own Bedrock keys.

Free 30-day trial, no credit card — then the Free plan with no time limit.