Pip download doesn't download all dependencies (setuptools and wheel are missing)

Hi, I need to offline install a python package via pip into a venv, but without internet connection. The package I actually want to install is here: GitHub - giggls/osml10n: Localization functions for Openstreetmap and I cloned it to ~/osml10n.

Then I make a new venv: python3 -mvenv ~/venv
and then i do ~/venv/bin/pip download ~/osml10n/
and i get a bunch of packages downloaded in my cwd.

After that, I do ~/venv/bin/pip install --no-index --find-links . ~/osml10n/, but i get an error:

      ERROR: Could not find a version that satisfies the requirement setuptools (from versions: none)
      ERROR: No matching distribution found for setuptools

I could already figure out, that it helps to ~/venv/bin/pip download setuptools
Then a setuptools package gets downloaded and the previous pip install finds it.
Then the same goes for wheel, after separate pip download wheel it’s fine.

Now I’m wondering (TBH, I don’t have much experience with the details of pip or python packaging), why doesn’t pip download all packages, the following pip install needs? Is there a mistake somewhere, maybe in osml10n, maybe theses packages aren’t direct dependencies, but recursive from some other package and pip download requires a flag for recursive dependencies?

If it matters, i’m on ubuntu 24.04

Please see

1 Like

Ok, thx, than I will stick to manual download, until this is fixed.

Would it help to build a wheelhouse?

I am not sure, I have not tested this exactly in a while, but for example instead of ~/venv/bin/pip download ~/osml10n/ you could try ~/venv/bin/pip wheel ~/osml10n/. If I am not mistaken this should get you wheels (it will build them if necessary) and then you can move all those wheels to the host machine that does not have internet access.


1 Like

Thx, didn’t now about pip wheel. Sounds like it fits my needs, and will give it a try.

You may also be interested in GitHub - python-wheel-build/fromager: Build your own wheels as a tool for building that wheelhouse. It does include build dependencies. It’s a new project, so the documentation is still a bit sparse. Let me know if you try it and run into issues.

1 Like

Ok, i checked this, but what is the difference to pip wheel?
As far as I understand, they both do the same thing, aren’t they?

After trying, and reading about what wheels actually are, this is the right solution for my case, thx.

1 Like

pip wheel builds a wheel of something, but it may use pre-built wheels from pypi for the build dependencies (if they exist).

fromager allows you to alway starts from source for every package, even build dependencies.

Ok, I understand. so, pip wheel is sufficient for me, but thx for pointing me there.