Search code examples
pythonpipofflinepypi

How can I download a PyPI package for pip installation at a later date?


I have a pip requirements file with pinned package versions. I need to install PyPI packages on a system without a direct internet connection. How can I easily download the packages I need now, for pip installation later, without visiting each package page myself?


Solution

  • The pip documentation has a good example of fast and local installs:

    $ pip install --download <DIR> -r requirements.txt
    $ pip install --no-index --find-links=[file://]<DIR> -r requirements.txt
    

    This is mostly for speed, but if you do the first step on an internet connected machine, copy the files to the other machine, then run the second step, you should be able to install all of your requirements without an internet connection.