【问题标题】:ModuleNotFoundError: No module named 'websockets'ModuleNotFoundError:没有名为“websockets”的模块
【发布时间】:2019-12-12 11:45:16
【问题描述】:

我的 python 版本是 3.6。我正在将本教程用于 Statecraft AI (https://pythonprogramming.net/building-neural-network-starcraft-ii-ai-python-sc2-tutorial/)。我从这里 (https://github.com/daniel-kukiela/python-sc2) 导入了 SC2 模块。

我在运行时遇到此错误

ModuleNotFoundError: 没有名为“websockets”的模块

【问题讨论】:

  • 我已经使用上面的链接使用 pip install websocket 安装了 web socket。但它仍然无法导入 websocket
  • 你的机器上是否同时安装了 python 2.x 和 3.x。如果是,请尝试pip3 install websockets

标签: python-3.x neural-network artificial-intelligence reinforcement-learning


【解决方案1】:

我花了几个小时尝试安装和卸载 websocket 和 websocket-client,但我需要的真正模块名为 websocket_client。

pip install websocket_client

【讨论】:

    【解决方案2】:

    尝试使用 pip3,它对我有用。

    【讨论】:

    • 使用评论部分获得如此简短的建议。
    【解决方案3】:

    【讨论】:

      猜你喜欢
      • 2019-03-28
      • 2022-01-07
      • 2017-12-14
      • 2020-12-10
      • 2021-09-02
      • 2020-10-10
      • 2022-01-06
      • 2021-09-10
      相关资源
      最近更新 更多