'ModuleNotFoundError: No module named 'awscli' after Mac os update

awscli does not work after Mac os update.

while running a bash script got following error:

File "/usr/local/bin/aws", line 19, in <module>
    import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'

Tried:

 pip3 install awscli --upgrade --user

While installing awscli got following warning and error:

WARNING: Ignoring invalid distribution -oto3 (/Users/myaccount/.pyenv/versions/3.6.9/lib/python3.6/site-packages)

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
boto3 1.10.16 requires botocore<1.14.0,>=1.13.16, but you have botocore 1.24.15 which is incompatible.
boto3 1.10.16 requires s3transfer<0.3.0,>=0.2.0, but you have s3transfer 0.5.2 which is incompatible.
aiobotocore 1.3.3 requires botocore<1.20.107,>=1.20.106, but you have botocore 1.24.15 which is incompatible.

uninstall botocore and reinstall it, still get above warning and error. Take a look of pip3

which pip3
/Users/myaccount/.pyenv/shims/pip3

What might cause this problem?



Solution 1:[1]

Personally, I'd consider using brew to install the awscli, not pip. You (probably) only want one awscli installed, but you potentially have multiple installations of Python, including the stock Mac OS-provided Python.

The awscli now comes with its own binaries so doesn't need an external Python installation anyway.

If you need boto3 or, less frequently, botocore then install those using your pip of choice.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jarmod