Search code examples
pythonvirtualenvpip

Replicate virtualenv without downloading all the packages again on the same machine


I have a couple projects that require similar dependencies, and I don't want to have pip going out and DLing the dependencies from the web every time. For instance I am using the norel-django package which would conflict with my standard django (rdbms version) if I installed it system wide.

Is there a way for me to "reuse" the downloaded dependancies using pip? Do I need to DL the source tar.bz2 files and make a folder structure similar to that of a pip archive or something? Any assistance would be appreciated.

Thanks


Solution

  • Add the following to $HOME/.pip/pip.conf:

    [global]
    download_cache = ~/.pip/cache
    

    This tells pip to cache downloads in ~/.pip/cache so it won't need to go out and download them again next time.