How can I download and setup a offline pypi repository for my homelab (disconnected from internet, only offline lab). I want to download all .tar.gz/.whl files that work only in 3 versions of python (and not download everything in pypi).
The official python docs suggested using Bandersnatch, but I have not had luck with it. It downloaded about 1.1TB of packages with the below configuration, but never downloaded the "requests" package (which is supposed to be requests-2.31.0.tar.gz or requests-2.31.0-py3-non-any.whl). These files did not get downloaded.
Can someone verify my banderswitch config file:
# cat /etc/bandersnatch.conf | grep -v '^;' | sed '/^$/d'
[mirror]
directory = /mnt/mylabnas01/repos/pypi
json = false
release-files = true
cleanup = false
master = https://pypi.org
timeout = 10
global-timeout = 1800
workers = 5
hash-index = false
simple-format = ALL
stop-on-error = false
storage-backend = filesystem
verifiers = 3
compare-method = hash
[allowlist]
platforms =
py3.6.8
py3.8.6
py3.8.7
py3.10.6
When, I used the above configuration file as "/etc/bandersnatch.conf". and ran bandersnatch mirror ... after ~5 days it downloaded 1.1TB of packages.
# du -sh ./pypi/web/
1.1T ./pypi/web/
It created a folder which contained directories like this:
./pypi/web/simple/
./pypi/web/packages/a9/09/78fd02c25977348689dbec2040e92c93ce743073842132c0e9f9910a223e/flask_dance-6.2.0-py3-none-any.whl
./pypi/web/packages/91/c8/cfbf90d7d1d148c5e0be4744d98acf900ce14486257407dd0565c667b892/flaskconstructicon-1.0.3-py3-none-any.whl
./pypi/web/packages/91/53/b0a9fcc1b1297f51e68b69ed3b7c3c40d8c45be1391d77ae198712914392/flask_sqlalchemy-3.1.1.tar.gz
./pypi/web/packages/91/6a/161c7730b8d55c88ec826d7b389098787939427c3202270cb9d07df73746/flask_image_search-0.5.0-py2.py3-none-any.whl
./pypi/web/packages/91/cc/7b14c479b4631cfaf6d582cf9c3511717f6dc5df8fda7037b53da6f5cf43/aa_standingsrequests-1.3.0-py3-none-any.whl
./pypi/web/packages/da/57/33191298260e491d1d4fea7e6a10fac124b6fc90b5fdbe368d32d31ee6a7/flask_sqlalchemy_whoosh-0.1.2-py2.py3-none-any.whl
... and so forth.
There are zips/wheel files, so bandersnatch did download the files, but when searching for "requests" it was not downloaded.
How can I resolve this?
- 20231109: Fixed question english: Sorry I was a bit vague in my original question. Appreciate the kind feedback.
from How can I download Pypi Repository which only contains packages for Python 3.6.8, 3.8.6, 3.10.6 with Bandersnatch to host in Offline Lab?
No comments:
Post a Comment