Although this question is a bit outdated, I would like to add an answer to it, since I recently ran into the same problem, but managed to find a way around this. I tried to install this on an instance running CentOS 7.
When I run the install command for the first time, I get exactly the same error log that @ user2061886 reports. The installer logs to a file with the following path: /var/log/awslogs-agent-setup.log. I linked the file and found that internally the installer complained that it could not find the file "Python.h":
creating build/temp.linux-x86_64-2.7 checking if libyaml is compilable gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,- D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer- size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/check_libyaml.c -o build/temp.linux-x86_64-2.7/check_libyaml.o checking if libyaml is linkable gcc -pthread build/temp.linux-x86_64-2.7/check_libyaml.o -L/usr/lib64 -lyaml -o build/temp.linux-x86_64-2.7/check_libyaml building '_yaml' extension creating build/temp.linux-x86_64-2.7/ext gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
I could not get it to work with Python 2.7, so I switched to Python 3.5. To install Python 3.5 on CentOS 7:
yum -y udpate yum install -y epel-release yum install -y http://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/ius- release-1.0-13.ius.centos7.noarch.rpm yum -y update yum install -y python35u*
I ran the installer command again and received the error message reported by @ user2061886. I could install and configure CloudWatch Logs Agent. However, shortly after starting the service (sudo service awslogs start), I ran into a second problem. This time I had to write the following file to determine the problem: /var/log/awslogs.log. Cloudwatch Log Agent mainly complained that it could not find the cwlogs package:
Traceback (most recent call last): File "/var/awslogs/bin/aws", line 27, in <module> sys.exit(main()) File "/var/awslogs/bin/aws", line 23, in main return awscli.clidriver.main() File "/usr/lib/python3.5/site-packages/awscli/clidriver.py", line 55, in main driver = create_clidriver() File "/usr/lib/python3.5/site-packages/awscli/clidriver.py", line 64, in create_clidriver event_hooks=emitter) File "/usr/lib/python3.5/site-packages/awscli/plugin.py", line 44, in load_plugins modules = _import_plugins(plugin_mapping) File "/usr/lib/python3.5/site-packages/awscli/plugin.py", line 58, in _import_plugins plugins.append(__import__(path)) ImportError: No module named 'cwlogs'
I solved this by manually installing the package using pip:
pip3.5 install awscli-cwlogs.
This solved the problem!