https://prefect.io logo
Title
t

Tibs

01/10/2023, 7:17 AM
Hi, I get a warning when using prefect-aws components to build blocks:
Warning!  Failed to load collection 'prefect_aws_ecs': ImportError: cannot import name 'AwsCredentials' from partially initialized module 'prefect_aws' (most likely due to a circular import)
My import statement:
from prefect_aws.credentials import AwsCredentials
from prefect_aws.s3 import S3Bucket
from prefect_aws.ecs import ECSTask
prefect-aws version 0.1.8
a

alex

01/10/2023, 1:30 PM
Hey @Tibs! I believe that error was fixed in a later release of
prefect-aws
. Are you able to upgrade to 0.2.2?
t

Tibs

01/10/2023, 1:32 PM
@alex thanks, I will try to update
@alex after upgrading, there is another error
ModuleNotFoundError: No module named 'mypy_boto3_s3'
The import statement is the same
from prefect_aws.credentials import AwsCredentials
from prefect_aws.s3 import S3Bucket
from prefect_aws.ecs import ECSTask
a

alex

01/10/2023, 2:42 PM
Ah yes, there’s an unreleased fix for that. We will get that released ASAP. In the mean time you can install that package with
pip install mypy_boto3_s3
Actually, I gave you the wrong version earlier. Can you install 0.2.3? That’s the latest version.
t

Tibs

01/10/2023, 2:49 PM
Thanks @alex, updated to 0.2.3 worked
I just hope the new mypy_boto3_s3 package will not cause conflicts with the version of boto3 that we use, I had this in the past with s3fs.. https://prefect-community.slack.com/archives/C048K20H0KZ/p1669652364964379
a

alex

01/10/2023, 2:53 PM
Those are just type hints and shouldn’t affect any functionality. Plus we don’t pin an upper limit on the boto3 version in
prefect-aws
, so I don’t expect any issues. If you do experience any issues, let us know!
👍 2