title: Sha256 Mismatch for pip install on fresh docker image
body: <p>I am trying to create a docker image with a bunch of python libraries.</p>
  <p>On doing a <code>pip install --no-cache-dir -r requirements.txt</code>, it keeps failing with mismatched hashes for libraries, especially pyspark.</p>
  <p>The failure message looks like -</p>
  <pre><code>ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
      pyspark==2.4.6 from https://files.pythonhosted.org/packages/e9/e4/5c15ab8d354c4e3528510821865e6748209a9b0ff6a1788f4cd36cc2a5dc/pyspark-2.4.6.tar.gz#sha256=b4b319a3ffd187a3019f654ae1c8ac38048bcec2940f8cecdef829302d166feb (from -r requirements.txt (line 4)):
          Expected sha256 b4b319a3ffd187a3019f654ae1c8ac38048bcec2940f8cecdef829302d166feb
               Got        e15b72fe55a366df7329932882c56328874152cf618950c7ce45e11f1c9dc5d1
  </code></pre>
  <p>Some stuff that I have already tried, consulting other stack overflow threads -</p>
  <ol>
  <li>Remove <code>__pycache__</code> and <code>~/.cache/</code> directories.</li>
  <li>Downgrade pip to 20.0.2, since there were threads saying that this was caused by pip20.1.0</li>
  <li>Also tried using <code>--no-cache-dir</code> as you can see.</li>
  <li>Build the docker image without caching using - <code>docker build --no-cache . -t labydock-image</code></li>
  </ol>
  <p>The Dockerfile looks something like this -</p>
  <pre><code>FROM python:3.7.7-stretch
  
  USER root
  RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends openjdk-8-jdk
  
  WORKDIR /labyrinth
  COPY ./dodo.py .
  COPY ./requirements.txt .
  
  RUN pip install pip==20.0.2
  
  RUN rm -rf ~/.cache
  RUN rm -rf __pycache__
  
  RUN pip install --no-cache-dir -r requirements.txt
  </code></pre>
  <p>And the corresponding requirements.txt file looks like this -</p>
  <pre><code>mockito==1.2.1
  py4j==0.10.7
  pypandoc==1.5
  pyspark==2.4.6
  pytest
  pandas
  doit
  koalas
  requests
  presto-client
  mysql-connector-python
  </code></pre>
  <p>Any help would be highly appreciated. Please let me know if you need more details</p>