【问题标题】:Docker/Linux: 'x86_64-linux-gnu-gcc' failed with exit status 1Docker/Linux:“x86_64-linux-gnu-gcc”失败,退出状态为 1
【发布时间】:2021-11-07 21:12:14
【问题描述】:

我在尝试加载我的 docker 容器时遇到此错误,特别是在尝试安装 pyodbc 包时。

我在这里尝试了所有修复:command 'x86_64-linux-gnu-gcc' failed with exit status 1

但我仍然收到以下错误:

#17 14.20     In file included from src/buffer.cpp:12:
#17 14.20     src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
#17 14.20        56 | #include <sql.h>
#17 14.20           |          ^~~~~~~
#17 14.20     compilation terminated.
#17 14.20     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我的 dockerfile 看起来像:

FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install python3-dev -y
RUN apt-get install python3-pip -y
RUN apt-get install libssl-dev -y
RUN apt-get install build-essential -y
RUN apt-get install libffi-dev -y
RUN apt-get install libsnappy-dev -y
RUN apt-get install lib32ncurses5-dev -y
RUN apt-get install libpcap-dev  -y
RUN apt-get install libpq-dev -y

COPY ./requirements.txt /app/requirements.txt

WORKDIR /app

RUN pip3 install python-snappy

RUN pip3 install -r requirements.txt

COPY . /app

ENTRYPOINT [ "python3" ]

CMD [ "app.py" ]

【问题讨论】:

  • 注意:apt-get install 在一行接受多个包

标签: python linux docker ubuntu


【解决方案1】:

在安装pyodbc之前需要apt-get install unixodbc-dev -ysql.h在那个包里,看下一个:

/# dpkg -L unixodbc-dev | grep sql.h
/usr/include/sql.h

【讨论】:

  • 做到了!否则我不知道我会如何解决这个问题。
猜你喜欢
  • 2022-12-03
  • 2017-05-20
  • 2016-01-08
  • 2016-04-18
  • 1970-01-01
  • 2016-08-27
  • 2015-01-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多