awscli 'unknown encoding' error
Just installed the AWS CLI on my Mac and encountered the 'unknown encoding' error when I first tried to use it:
$ aws ec2 describe-instances
unknown encoding:
$
This is caused by the default encoding not being set in Python. There's a couple different ways to go about setting it but the easiest I found was just adding the following to my ~/.bash_profile
:
export PYTHONIOENCODING=utf-8
Open up a new terminal or source the your .bash_profile again and everything will be working swimmingly:
$ aws ec2 describe-instances | head
{
"Reservations": [
{
"OwnerId": "",
"ReservationId": "",
"Groups": [],
"Instances": [
{
"Monitoring": {
"State": "disabled"