错误:扭曲 iocp 支持的构建轮失败

sun*_*day 4 python django django-rest-framework docker

错误图像

\n

我试图安装 daphne===4.0.0 但我不断收到此错误,

\n
ERROR: Failed building wheel for twisted-iocpsupport\n\n    Building wheels for collected packages: twisted-iocpsupport\n  Building wheel for twisted-iocpsupport (pyproject.toml) ... error\n  error: subprocess-exited-with-error\n\n  \xc3\x97 Building wheel for twisted-iocpsupport (pyproject.toml) did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [5 lines of output]\n      running bdist_wheel\n      running build\n      running build_ext\n      building \'twisted_iocpsupport.iocpsupport\' extension\n      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/\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\n  ERROR: Failed building wheel for twisted-iocpsupport\nFailed to build twisted-iocpsupport\nERROR: Could not build wheels for twisted-iocpsupport, which is required to install pyproject.toml-based projects\n
Run Code Online (Sandbox Code Playgroud)\n

小智 8

根据文档

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

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

  • 这解决了我的问题。安装 scrapy 后使用“pip freeze”会生成一个固定了“twisted_iocpsupport”的依赖项列表,从requirements.txt 中删除依赖项修复了该问题。 (2认同)