One day out of the blue I started having issues with the AWS CLI installed on my macOS Catalina (Version 10.15.4). Below is the error that I was getting when trying to access aws cli command:

I tried searching for a solution for this and unfortunately, at the time of writing, I was not able to find an appropriate solution. If the same is happening with you then the solution is pretty straight forward. There are two ways you should be able to solve this:

Solution 1:

The easiest solution and the first one to try would be to run the commands above. This will update the home-brew and upgrade the installed software if applicable. If you run the command (that you were originally trying to run; which was was —version in my case), you should be able to see the result without any issues. If you still see the same error then you can follow solution 2 below.

Solution 2:

This will uninstall and re-install awscli package on your machine. If you run your original command now (“aws —version” in my case), you should be able to see the results.

Hope this helps :). Happy coding.