سؤال

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.

هل كانت مفيدة؟

المحلول

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)

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top