Locust AWS python 要求失败

Locust AWS python 要求失败

各位,尝试使用最新的 amazon linux 在 AWS 中设置 Locust。安装 locust 后,在主模式下启动时出现以下信息:

locust -f foo.py --master
Traceback (most recent call last):
  File "/usr/bin/locust", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests>=2.4.1

最优雅的解决方法是什么?谢谢

答案1

好吧,如果有人关心的话,将 Python 升级到 v2.7 可以解决我的问题:

http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2

33  yum install make automake gcc gcc-c++ kernel-devel git-core -y
34  yum install python27-devel -y
35  rm /usr/bin/python
36  ln -s /usr/bin/python2.7 /usr/bin/python
37  cp /usr/bin/yum /usr/bin/_yum_before_27
38  sed -i s/python/python2.6/g /usr/bin/yum
39  sed -i s/python2.6/python2.6/g /usr/bin/yum
40  python -V

相关内容