Error: ImportError: No module named boto3 (DynamoDB)
Solution
boto3 is the AWS SDK for Python. This error usually appears in Python applications where it's failing to import the boto3 library. Depending on your environment and setup, the solution is:
-
When using Python 2 (you shouldn't, it's deprecated):
pip2.7 install boto # or pip install boto
-
When using Python 3:
pip install --upgrade --user boto3 # or pip3 install boto
-
If you're using Python project with requirements.txt and boto3 is included there:
python -m pip install -r requirements.txt
-
If you want to install a specific version of boto3:
# Install Boto3 version 1.0 specifically pip install boto3==1.0.0 # Make sure Boto3 is no older than version 1.15.0 pip install boto3>=1.15.0 # Avoid versions of Boto3 newer than version 1.15.3 pip install boto3<=1.15.3
-
On Ubuntu, you might also try using apt:
apt install python-boto3
If you're looking for other boto3 related help, head to our DynamoDB and Python guide.
Other Common DynamoDB Errors (with Solutions)
- Unable to start DynamoDB Local process
- ConfigError: Missing region in config
- DynamoDB Key element does not match the schema
- DynamoDB ConditionalCheckFailedException
- DynamoDB ValidationException: Query condition missed key schema element
- DynamoDB Invalid UpdateExpression Syntax Error Token
- DynamoDB error cannot find module build/Release/DTraceProviderBindings
- sls dynamodb install not working
- DynamoDB Internal Server Error
- AWS DynamoDB errors ResourceNotFoundException
- ImportError: No module named boto3 (DynamoDB)
- AWS DynamoDB CredentialsError: Missing credentials in config
- DynamoDB Network Error: self signed certificate in chain
- ValidationException: Invalid KeyConditionExpression: Attribute name is a reserved keyword;
- ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An AttributeValue may not contain an empty string
- Error ValidationException: One or more parameter values were invalid: Type mismatch for key X expected: S actual: M
- One or more parameter values were invalid: some AttributeDefinitions are not used
Tired of switching accounts and regions? Use Dynobase.
Try 7-day free trial. No strings attached.
© 2022 Dynobase