<p>There is a python project in which I have dependencies defined with the help of "requirement.txt" file. One of the dependencies is gmpy2. When I am running <code>docker build -t myimage .</code> command it is giving me following error at the step when setup.py install is getting executed. </p>

<pre><code>In file included from src/gmpy2.c:426:0:
src/gmpy.h:252:20: fatal error: mpfr.h: No such file or directory
include "mpfr.h"
</code></pre>

<p>similarly other two errors are:</p>

<pre><code>In file included from appscript_3x/ext/ae.c:14:0:
appscript_3x/ext/ae.h:26:27: fatal error: Carbon/Carbon.h: No such file    
or directory
#include &lt;Carbon/Carbon.h&gt;

In file included from src/buffer.cpp:12:0:
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
#include &lt;sql.h&gt;
</code></pre>

<p>Now question is how i can define or install these internal dependencies required for successful build of image. As per my understanding gmpy2 is written in C and depends on three other C libraries: GMP, MPFR, and MPC and it is unable to find this.</p>

<p>Following is my docker-file:</p>

<pre><code>FROM python:3

COPY . .

RUN pip install -r requirement.txt

CMD [ "python", "./mike/main.py" ]
</code></pre>

<p>Install this <code>apt install libgmp-dev libmpfr-dev libmpc-dev</code> extra dependency and then <code>RUN pip install -r requirement.txt</code>
i think it will work and you will be able to install all the dependency and build docker image.</p>

<pre><code>FROM python:3

COPY . .

RUN apt-get update -qq &amp;&amp; \
apt-get install -y --no-install-recommends \
libmpc-dev \
libgmp-dev \
libmpfr-dev

RUN pip install -r requirement.txt

CMD [ "python", "./mike/main.py" ]
</code></pre>

<p>if apt not run you can use Linux as base image.</p>
