title: How to force pip to get a wheel package (even for package dependencies)?
body: <p>I'm trying to build a multistage docker image with some python packages. For some reason, <code>pip wheel</code> command still downloads source files <code>.tar.gz</code> for few packages even though <code>.whl</code> files exist in Pypi. For example: it does it for pandas, numpy.</p>
  
  <p>Here is my requirements.txt:</p>
  
  <pre><code># REST client
  requests
  
  # ETL
  pandas
  
  # SFTP
  pysftp
  paramiko
  
  # LDAP
  ldap3
  
  # SMB
  pysmb
  </code></pre>
  
  <p>First stage of the Dockerfile:</p>
  
  <pre><code>ARG IMAGE_TAG=3.7-alpine
  FROM python:${IMAGE_TAG} as python-base
  COPY ./requirements.txt /requirements.txt
  RUN mkdir /wheels &amp;&amp; \
      apk add build-base openssl-dev pkgconfig libffi-dev
  RUN pip wheel --wheel-dir=/wheels --requirement /requirements.txt
  ENTRYPOINT tail -f /dev/null
  </code></pre>
  
  <p>Output below shows that it is downloading source package for <em>Pandas</em> but it got a wheel for <em>Requests</em> package. Also, surprisingly it takes a lot of time (<em>I really mean a lot of time</em>) to download and build these packages !!</p>
  
  <pre><code>Step 5/11 : RUN pip wheel --wheel-dir=/wheels --requirement /requirements.txt
   ---&gt; Running in d7bd8b3bd471
  Collecting requests (from -r /requirements.txt (line 4))
    Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    Saved /wheels/requests-2.22.0-py2.py3-none-any.whl
  Collecting pandas (from -r /requirements.txt (line 7))
    Downloading https://files.pythonhosted.org/packages/0b/1f/8fca0e1b66a632b62cc1ae38e197befe48c5cee78f895edf4bf8d340454d/pandas-0.25.0.tar.gz (12.6MB)
  
  </code></pre>
  
  <p>I would like to know how I can force it get a wheel file for all the required packages and also for the dependencies listed in these packages. I observed that some dependencies get a wheel file but others get the source packages.</p>
  
  <p>NOTE: code above is a combination of multiple online sources.</p>
  
  <p>Any help to make this build process easier is greatly appreciated. </p>
  
  <p>Thanks in Advance.</p>