当我在 DockerFile 中运行
faust --version
时,我收到以下错误:
Traceback (most recent call last):
File "/usr/local/bin/faust", line 5, in <module>
from faust.cli.faust import cli
File "/usr/local/lib/python3.8/dist-packages/faust/cli/faust.py", line 9, in <module>
from .model import model
File "/usr/local/lib/python3.8/dist-packages/faust/cli/model.py", line 8, in <module>
from faust.models import registry
File "/usr/local/lib/python3.8/dist-packages/faust/models/__init__.py", line 4, in <module>
from .record import Record
File "/usr/local/lib/python3.8/dist-packages/faust/models/record.py", line 20, in <module>
from mode.utils.compat import OrderedDict
ImportError: cannot import name 'OrderedDict' from 'mode.utils.compat' (/usr/local/lib/python3.8/dist-packages/mode/utils/compat.py)
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
我在我的服务中使用
faust-streaming==0.10.13
和python==3.8版本。
我已尝试将其升级到最新版本,即
faust-streaming 0.11.0
但仍然遇到相同的错误。谁能帮我解决这个问题吗?
我的工作也遇到了同样的问题,其背后的原因是 faust 使用的模式包似乎是实模式包的修改版本,并且开发人员似乎创建了自己的代码,因此您只需要使用在这些更改出现之前,旧版本的“浮士德模式”。
在调用 faust-streaming==0.10.13 之后,在您的requirements.txt 文件中,添加一行内容:mode-streaming==0.3.5
模式版本 0.3.5 及更早版本使用适用于您的 faust 流版本的语法