I'm new to Python. Was following some videos last week where we were translating a string from English to French. That went fine. I moved on and was following other videos and now I keep getting this error:
Traceback (most recent call last): File "/home/ec2-user/environment/Python_AWS/create_S3_bucket.py", line 3, in <module> import boto3 File "/home/ec2-user/.local/lib/python3.7/site-packages/boto3/init.py", line 14, in <module> import logging File "/home/ec2-user/environment/Python_AWS/logging.py", line 39, in <module> logging.info("The Source Language and Target Language codes are different - proceeding") # This will not print to the console because it is lower than warning AttributeError: module 'logging' has no attribute 'info'
Here is the code I'm trying to run:
import boto3
aws_resource = boto3.resource("s3")
# Name the bucket uniquely, no spaces
bucket = aws_resource.Bucket("test-bucket-198538723")
response = bucket.create(
ACL='public-read', #for private bucket, change 'public-read' to 'private'
CreateBucketConfiguration={
'LocationConstraint': 'us-east-2'
},
)
print(response)
I'm not even using logging in my code. It seems like it's referencing my old code file where I was translating language, but that file isn't even open. Any help would be greatly appreciated.
I've tried running different code and some run, and some give me the same error, for code also not using logging.