title: pip install is not getting overridden by --no-index and find-links for local dependencies
body: <p>I have Pkg-A that depends on Pkg-B. I pull in Pkg-A and B both on local machine. In <code>setup.py</code> for Pkg-A I instruct it to get Pkg-B locally like:</p>
  <pre><code>install_requires=[ 'somelib @ file://localhost/path/to/dir/of/pkg-B' ]
  </code></pre>
  <p>Pkg-B needs <code>gcc</code> on the build machine etc. So I install <code>gcc</code> and all that and create wheels of all the dependencies with:</p>
  <pre><code>pip wheel -r requirements.txt -w wheels
  </code></pre>
  <p>where <code>requirements.txt</code> is just <code>-e .</code></p>
  <p>Everything compiles fine and I have a <code>wheels/</code> dir with all the wheels (just 2 packages in this case). Now I goto a fresh machine/vm with all my wheels only to simulate a client machine (who I don't want to force to install <code>gcc</code> etc) and do:</p>
  <pre><code>pip install --no-index --find-links ./wheels pkg-A
  </code></pre>
  <p>I would expect this to succeed installation but it errors out with:</p>
  <blockquote>
  <p>ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: /path/to/dir/of/pkg-B</p>
  </blockquote>
  <p>Why? I have already built all the wheels and asked it to specifically look into the <code>./wheels</code> dir, so why is it searching for source code at that path?</p>
  <p>However if the <code>setup.py</code> pointed to some upstream repository like:</p>
  <pre><code>install_requires=[ 'somelib @ https://github.com/&lt;user&gt;/pkg-B' ]
  </code></pre>
  <p>then it all works fine. That is, I can build it locally ofc. just like before, but also when going over to the client machine with just the built wheels, it installs fine, using just the <code>--find-links</code> and ignoring reaching out to the upstream github repository (due to <code>--no-index</code> I guess).</p>
  <p>How do I make it ignore the local filepath similarly in the client machine and use only the info from the <code>wheels/</code> dir that I put in <code>--find-links</code>?</p>
  <p>[<code>python-3.8</code>, <code>pip-21.3.1</code>]</p>