【问题标题】:twisted-iocpsupport error when using pip on ubuntu / debian io.h missing在 ubuntu / debian io.h 上使用 pip 时出现扭曲 iocpsupport 错误
【发布时间】:2021-05-31 08:26:40
【问题描述】:

接收错误:

 Building wheel for twisted-iocpsupport (PEP 517): started
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmpv8s6qz76 build_wheel /tmp/tmp9l8hgcva
       cwd: /tmp/pip-install-qsr4j4x_/twisted-iocpsupport
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'twisted_iocpsupport.iocpsupport' extension
  creating build
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/twisted_iocpsupport
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Itwisted_iocpsupport -I/usr/include/pyth
on3.8 -c twisted_iocpsupport/iocpsupport.c -o build/temp.linux-x86_64-3.8/twisted_iocpsupport/iocpsupport.o
  twisted_iocpsupport/iocpsupport.c:631:10: fatal error: io.h: No such file or directory
    631 | #include "io.h"
        |          ^~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for twisted-iocpsupport
  Building wheel for twisted-iocpsupport (PEP 517): finished with status 'error'

channels==3.0.3
daphne==3.0.1
Twisted==21.2.0
twisted-iocpsupport==1.0.1

在 docker 环境中:

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -y install python3 python3-pip

WORKDIR /usr/src/app

# Copy requirements
COPY requirements.txt ./

RUN pip3 install -r requirements.txt

python:3.8debian:10.8 也没有机会 在apt 命令中包含python-dev 也无济于事。

不确定需要什么类型的io.h 文件以及如何获取它。在谷歌上,没有任何东西真正弹出,在扭曲矩阵的 2500 个未解决问题中,我找不到与此相关的任何内容。该版本似乎从今天 2021 年 3 月 1 日开始。1.0.0 上的相同错误

【问题讨论】:

    标签: python linux ubuntu twisted


    【解决方案1】:

    twisted-iocpsupport 是一个提供与 Windows“I/O 完成端口”API 绑定的包。这些是仅限 Windows 的 API。

    你不能在 Debian 上使用这个包。幸运的是,您也不需要这样做,因为您可以访问一个良好的基于​​ Linux 的非阻塞 I/O 系统 - epoll - 在 Twisted 中得到支持,无需使用任何额外的包。

    【讨论】:

    • 它通过从 requirements.txt 中删除包解决了这个问题,但问题是当我在我的开发环境(windows)上创建要求并在部署服务器(debian)上使用相同的要求时 pip 抛出错误是即使它在 requirements.txt 中可用,也有任何方法可以忽略此包
    • 如果你使用最近的 Twisted,那么你根本不需要声明一个 twisted-iocpsupport 依赖项(我不确定你是否做过)。扭曲取决于它。您依赖于 Twisted。 pip 安装你需要的东西。
    • 是的,它自动安装了 twisted-iocpsupport 但我通过使用 pip-chill 而不是 pip freeze 解决了这个问题
    • pip-chill 实际上用起来很爽。而不是转储每个包名称,它只是转储父包,从而减少了跨平台问题。
    猜你喜欢
    • 2017-06-27
    • 1970-01-01
    • 2013-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-20
    • 1970-01-01
    相关资源
    最近更新 更多