To install only from local you need 2 options:
--find-links
: where to look for dependencies. There is no need for the file://
prefix mentioned by others.--no-index
: do not look in pypi indexes for missing dependencies (dependencies not installed and not in the --find-links
path). So you could run from any folder the following:
pip install --no-index --find-links /srv/pkg /path/to/mypackage-0.1.0.tar.gz
If your mypackage is setup properly, it will list all its dependencies, and if you used pip download to download the cascade of dependencies (ie dependencies of depencies etc), everything will work.
If you want to use the pypi index if it is accessible, but fallback to local wheels if not, you can remove --no-index
and add --retries 0
. You will see pip pause for a bit while it is try to check pypi for a missing dependency (one not installed) and when it finds it cannot reach it, will fall back to local. There does not seem to be a way to tell pip to "look for local ones first, then the index".