【问题标题】:async keyword in module name is preventing import模块名称中的 async 关键字阻止导入
【发布时间】:2019-01-17 21:01:58
【问题描述】:

我正在尝试在 Python 3.7.2 和 Windows 10 下使用 pymodbus。有一个名为 pymodbus.server.async 的模块可以在 Python 2.7.14 中正常运行时间>。在 3.7 下看起来 async 现在是一个关键字,这会阻止模块被导入。我收到此错误:

from pymodbus.server.async import StartTcpServer
                           ^
SyntaxError: invalid syntax

有没有解决这个问题的正确方法?作为一个临时的权宜之计,将模块重命名为 bsync 但这不是一个可持续的解决方案。

【问题讨论】:

  • 在 Python3.7 中使用它:pymodbus.client.asynchronouspymodbus.client.aio

标签: python python-3.7 pymodbus


【解决方案1】:

找到解决方案pymodbus rc branch。模块重命名为asynchronous

【讨论】:

    猜你喜欢
    • 2020-05-11
    • 1970-01-01
    • 2019-03-03
    • 1970-01-01
    • 2016-08-27
    • 1970-01-01
    • 2021-12-02
    • 2023-02-06
    • 1970-01-01
    相关资源
    最近更新 更多