How to use Python's pip to download and keep the zipped files for a package?

前端 未结 8 963
暗喜
暗喜 2020-11-28 18:48

If I want to use the pip command to download a package (and its dependencies), but keep all of the zipped files that get downloaded (say, django-social

8条回答
  •  没有蜡笔的小新
    2020-11-28 19:44

    pip wheel is another option you should consider:

    pip wheel mypackage -w .\outputdir
    

    It will download packages and their dependencies to a directory (current working directory by default), but it performs the additional step of converting any source packages to wheels.

    It conveniently supports requirements files:

    pip wheel -r requirements.txt -w .\outputdir
    

    Add the --no-deps argument if you only want the specifically requested packages:

    pip wheel mypackage -w .\outputdir --no-deps
    

提交回复
热议问题