错误:为Twisted-iocpsupport构建轮失败。

4

error image

我正在尝试安装daphne===4.0.0,但是我一直收到这个错误提示:
ERROR: Failed building wheel for twisted-iocpsupport

    Building wheels for collected packages: twisted-iocpsupport
  Building wheel for twisted-iocpsupport (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for twisted-iocpsupport (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'twisted_iocpsupport.iocpsupport' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for twisted-iocpsupport
Failed to build twisted-iocpsupport
ERROR: Could not build wheels for twisted-iocpsupport, which is required to install pyproject.toml-based projects

安装 Microsoft Visual C++ 14.0 或更高版本。 - sahasrara62
我们还没有为Python 3.11发布这个模块。我刚刚看到这个问题启动了1.0.3版本的发布流程,应该会在一个小时内上传到PyPI,届时您将不再遇到这个问题。 - Glyph
2个回答

6
根据文档

应用程序不得直接从twisted_iocpsupport包中导入名称。

因此,如果您正在使用任何带有软件包版本控制的文件(requirements.txt、project.toml等),则应手动删除它。

2
这解决了我的问题。在安装Scrapy后使用pip freeze生成一个依赖列表,其中包含twisted_iocpsupport的固定版本,从requirements.txt中删除该依赖项即可解决问题。 - Dullson

1

出现此错误是因为 Python 3.11 不支持 twisted-iocpsupport。建议退回到 3.6 到 3.10 版本之间,这对我来说已经解决了问题。请前往 twisted-iocpsupport 文档并查看它支持的 Python 版本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接