AWS DynamoDB Boto3 - No module named ‘boto3.dynamodb.conditions.Key’
Learn how to handle ModuleNotFoundError: No module named 'boto3.dynamodb.conditions.Key';
error.
Solution
The whole error message looks something like this.
ModuleNotFoundError: No module named 'boto3.dynamodb.conditions.Key';
'boto3.dynamodb.conditions' is not a package
This is probably due to import syntax is incorrect. You probably imported conditions.Key
using the syntax below.
import boto3.dynamodb.conditions.Key
The above import syntax is incorrect. You should import a module from a package using the following syntax.
# from boto3.dynamodb.conditions import Key
from boto3.dynamodb.conditions import Key, Attr
Support Jun
Thank you for reading! Support Jun
If you are preparing for Software Engineer interviews, I suggest Elements of Programming Interviews in Java for algorithm practice. Good luck!
You can also support me by following me on Medium or Twitter.
Feel free to contact me if you have any questions.
Comments