【问题标题】:Locust.io: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibilityLocust.io:RuntimeWarning:greenlet.greenlet 大小已更改,可能表示二进制不兼容
【发布时间】:2020-10-14 22:29:23
【问题描述】:

这很烦人,所以我花了过去 15 个小时试图弄清楚为什么 locust.io 不会为我启动。在我的 mac 机器上,我试图获取一个 locust 运行的示例,以便我可以开始探索这个包。我使用 pip 在我的虚拟环境(python v3.7.7)中安装了 locust:pip install locust

所有包安装成功。

这里是示例代码:

from locust import HttpLocust,TaskSet

class MyTasks(TaskSet):
def index(self):
self.client.get("https://refinery.nypl.org/api/nypl/ndo/v0.1/content/alerts?filter[scope]=all")

class WebsiteUser(HttpLocust):
task_set = MyTasks

我在运行 locust -f mytestloc.py 时遇到了这个错误:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject

return f(*args, **kwds)

【问题讨论】:

  • 您是否尝试过运行基本示例?这应该有助于缩小问题的范围。 github.com/locustio/locust/blob/master/examples/basic.py 乍一看,您使用的是HttpLocust,这看起来很奇怪。也许改用HttpUser。不过,不知道为什么这会导致您的问题。
  • 嘿@Solowalker 是的,我尝试了基本示例以及添加 HttpUser 及其相同的错误消息。

标签: python locust


【解决方案1】:

Greenlet runtime error and deployed app in docker keeps booting all the workers

试试pip install --upgrade geventpip install greenlet==0.14.6

【讨论】:

  • 我已经将 locust 对 gevent 的依赖提高到需要 20.9.0+(最新)所以这不应该成为未来的问题(现在它应该只有在你出于某种原因拥有最新的 greenlet 时才会发生但不是最新的事件)
【解决方案2】:

试试pip install greenlet==0.4.16

【讨论】:

  • 欢迎来到 Stack Overflow。感谢您的贡献。但是,即使只是一个简短的解释,您能否添加一个解释。 How to Answer。亲切的问候。
猜你喜欢
  • 2018-12-31
  • 2021-05-04
  • 2021-12-12
  • 2014-11-03
  • 2020-06-04
  • 2021-07-06
  • 2021-10-30
  • 2021-05-09
相关资源
最近更新 更多