2

I'm setting up a local pypi server for a LAN where there is no internet access. To do so I want to download all the packages from the official pypi server in advance(then I move the server to the LAN).

It looks like the pep381client will do the job. However the command “pep381run.py py-pkgs” just happily prints out “Synchronizing xxx” (xxx is the package name) yet no any packages being found downloaded in the “py-pkgs” directory. Why?

The OS is windows7 BTW.

John Wang
  • 4,562
  • 9
  • 37
  • 54

2 Answers2

10

pep381 client use http, but pypi can only be used https. This program is not implemented function that redirect url. I modified the program as this.

file: (YOUR INSALLED DIRECTORY)/pep381client/__init__.py

 9: -BASE = 'http://'+pypi
    +BASE = 'https://'+pypi

28: -        _conn = httplib.HTTPConnection(pypi)
    +        _conn = httplib.HTTPSConnection(pypi)

37: -        _conn = httplib.HTTPConnection(pypi)
    +        _conn = httplib.HTTPSConnection(pypi)
Yuichiro
  • 1,220
  • 9
  • 8
  • 1
    Thank you Yuichiro, that works. So this looks like a bug and I've submit [an issue](https://bitbucket.org/loewis/pep381client/issue/26/pep381run-wont-download-package) to the author. – John Wang Jul 18 '13 at 06:55
  • Hi Yuichiro, my pep381client broken again. Could you help again ? I posted the question [here](http://stackoverflow.com/questions/17856803/pep381run-broken-when-restart-httplib-responsenotready) – John Wang Jul 25 '13 at 11:34
4

In case anyone has similar problems, they may be solved by migrating to bandersnatch. Which can be found here: https://pypi.python.org/pypi/bandersnatch

glormph
  • 994
  • 6
  • 13