I have this error when trying to load my docker container, specifically when trying to install the pyodbc
package.
I have tried all the fixes here: command 'x86_64-linux-gnu-gcc' failed with exit status 1
but I still get the following error:
#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
My dockerfile looks like:
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" ]
CodePudding user response:
You need apt-get install unixodbc-dev -y
before install pyodbc
, the sql.h
is in that package, see next:
/# dpkg -L unixodbc-dev | grep sql.h
/usr/include/sql.h