how to create a local PyPI mirror

PyPI is amazing, but it does have its drawbacks:

  • If PyPI is down, you can’t download any packages or run any tests
  • PyPI can be extremely slow at times
  • PyPI doesn’t offer private package support

The solution? set up a local PyPI mirror of course.

Python already has a PEP that describes the mirroring infrastructure for PyPI: PEP 381, and the tooling that implements it.

I started by looking at my options, and at the end decided to follow these articles to do so:

During my search endeavours, I found out that Artifactory provides support for PyPI repositories. If you already have it installed, I suggest using it instead.