Python Locust的默认安装会引发异常

时间:2015-03-19 04:16:26

标签: python linux centos7 locust

操作系统:CentOS 7.0 x64
解释器:使用--enable-shared

从源代码编译的Python 3.4.1

示例命令:

$ python3.4 -c "import locust"

回溯:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.4/site-packages/locust/__init__.py", line 1, in <module>
  from core import HttpLocust, Locust, TaskSet, task
File "/usr/local/lib/python3.4/site-packages/locust/core.py", line 106
  raise LocustError, LocustError("A task inside a Locust class' main TaskSet 
  (`%s.task_set` of type `%s`) seems to have called interrupt() or raised 
  an InterruptTaskSet exception. The interrupt() function is used to hand over execution
  to a parent TaskSet, and should never be called in the main TaskSet which a Locust
  class' task_set attribute points to." % (type(self).__name__, self.task_set.__name__)), sys.exc_info()[2]
                  ^
SyntaxError: invalid syntax

我很困惑...为什么在异常字符串中的“属性”一词上调用SyntaxError

我真的不确定在这里尝试什么。我做了一个strace,结果基本上是100%相同,所以没有额外的线索。

1 个答案:

答案 0 :(得分:1)

嗯,根据官方的蝗虫文档(http://docs.locust.io/en/latest/installation.html#supported-python-versions),它现在不能与Python 3.x兼容。

  

支持的Python版本
  Locust需要Python 2.6+。它目前与Python 3.x不兼容。

也许这就是问题?

相关问题