小编sar*_*mar的帖子

无法在 docker 中安装 pyodbc 并获取错误命令“gcc”失败,退出状态为 1

我正在尝试在 linux 容器内运行的 docker 中安装 pyodbc 但出现以下错误

单击此处查看图像

 src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
   #include <sql.h>
            ^~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyodbc
Run Code Online (Sandbox Code Playgroud)

这是我的 dockerfile

FROM mcr.microsoft.com/azure-functions/python:2.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY . /home/site/wwwroot
FROM ubuntu
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
    apt-get -y install gcc mono-mcs && \
    rm -rf /var/lib/apt/lists/*
FROM  python
RUN apt-get update && apt-get install -y python3-pip
# RUN …
Run Code Online (Sandbox Code Playgroud)

azure python-3.x docker docker-build azure-functions

12
推荐指数
3
解决办法
6892
查看次数