当我运行awslogs的python脚本时,我正在ec2实例上设置awslogs代理。我收到以下消息。
正在下载最新的CloudWatch Logs代理位...错误:无法创建virtualenv。在运行此脚本之前,请尝试使用pip手动安装并将其添加到sudo用户的PATH中。
awslogs-agent-setup.log 显示以下错误。
环境:CentOS 6.10和Python 2.6
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
/usr/bin/virtualenv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 7, in <module>
from virtualenv import main
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 51, in <module>
print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
答案 0 :(得分:0)
基本上,此错误是由于python 2.6版引起的。您能否将python版本从2.6更新到 2.7或3.1 。
这应该有帮助。