python - Python Locust 的默认安装抛出异常

标签 python linux centos7 locust

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

从源代码编译

示例命令:

$ 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

我很困惑...为什么它会在异常字符串中的单词“attribute”上调用 SyntaxError

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

最佳答案

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

Supported Python Versions
Locust requires Python 2.6+. It is not currently compatible with Python 3.x.

也许这就是问题所在?

关于python - Python Locust 的默认安装抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29137121/

相关文章:

python - 如何访问和修改 LabTestRepository 类中的 __list_of_hospital_lab_test_ids?

linux - 为什么vim在没有安装cscope的情况下支持cscope?

mysql - 加载共享库 : libnuma. so.1 时出错:无法打开共享对象文件:没有这样的文件或目录

linux - 如何在Centos 7上运行macos

javascript - 工具提示在 Chart.js 中不起作用。有任何想法吗?

python - 如何在波斯语文本上创建可搜索树?

python - 我如何找出使用什么编码产生一些乱码的中文文本?

linux - 十六进制到 TCP 端口 - BASH

Linux - 如何列出所有用户及其 UID

linux - 作为用户的 Systemd 服务单元文件