title: Why is setuptools not available in environment Ubuntu docker image with Python & dev tools installed?
body: <p>I'm trying to build a Ubuntu 18.04 Docker image running Python 3.7 for a machine learning project. When installing specific Python packages with <code>pip</code> from <code>requirements.txt</code>, I get the following error:</p>
  <pre><code>Collecting sklearn==0.0
    Downloading sklearn-0.0.tar.gz (1.1 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error
    
    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─&gt; [1 lines of output]
        ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
        [end of output]
  </code></pre>
  <p>Although here the error arises in the context of <code>sklearn</code>, the issue is not specific to one library; when I remove that libraries and try to rebuild the image, the error arises with other libraries.</p>
  <p>Here is my <code>Dockerfile</code>:</p>
  <pre><code>FROM ubuntu:18.04
  
  # install python
  RUN apt-get update &amp;&amp; \
      apt-get install --no-install-recommends -y \
      python3.7 python3-pip python3.7-dev
  
  # copy requirements
  WORKDIR /opt/program
  COPY requirements.txt requirements.txt
  
  # install requirements
  RUN python3.7 -m pip install --upgrade pip &amp;&amp; \
      python3.7 -m pip install -r requirements.txt
  
  # set up program in image
  COPY . /opt/program
  </code></pre>
  <p>What I've tried:</p>
  <ul>
  <li>installing <code>python-devtools</code>, both instead of and alongside, <code>python3.7-dev</code> before installing requirements with <code>pip</code>;</li>
  <li>installing <code>setuptools</code> in <code>requirements.txt</code> before affected libraries are installed.</li>
  </ul>
  <p>In both cases the same error arose.</p>
  <p>Do you know how I can ensure <code>setuptools</code> is available in my environment when installing libraries like <code>sklearn</code>?</p>