Let's say you have 2 packages you want to install from locally: abc-xyz and foo, and you have your corresponding package files abc-xzy-1.2.3.tar.gz and foo-1.0.0.tar.gz.
We'll put your local pypi directory at /my_local_pypi/simple
Your directory structure will look like:
/my_local_pypi/simple
index.html
- abc-xyz/
index.html
abc-xyz-1.2.3.tar.gz
- foo/
index.html
foo-1.0.0.tar.gz
The root index.html needs <a href></a> anchor entries for each package, so should look like:
$ cat /my_local_pypi/simple/index.html
<!DOCTYPE html><html><body>
<a href="abc-xyz">abc-xyz></a></br>
<a href="foo">foo</a></br>
</body></html>
Then each $package/index.html needs an <a href></a> anchor pointing to the actual package file, so they should look like:
$ cat /my_local_pypi/simple/abc-xyz/index.html
<!DOCTYPE html><html><body>
<a href="abc-xyz-1.2.3.tar.gz">abc-xyz-1.2.3.tar.gz</a></br>
</body></html>
$ cat /my_local_pypi/simple/foo/index.html
<!DOCTYPE html><html><body>
<a href="foo-1.0.0.tar.gz">foo-1.0.0.tar.gz</a></br>
</body></html>
Then in your requirements.txt, you can do:
$ cat requirements.txt
--extra-index-url file:///my_local_pypi/simple/
abc-xyz==1.2.3
foo==1.0.0
And then you should be good to go: pip install -r requirements.txt
See also the piprepo project, which does a pretty good job of generating the local directory structure needed.
pip install -r requirements.txt