What's the best way to download a python package and it's dependencies from pypi for offline installation on another machine? Is there any easy way to do this with pip or easy_install? I'm trying to install the requests library on a FreeBSD box that is not connected to the internet.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Update 2018-10-10
pip
has a relatively new command calleddownload
. Thedownload
command let's you get the package without the installation.older versions of pip
I use the
-d
(or--download
) option topip install
, which makes the process of downloading sdist tarballs from PyPI much simpler. For instance,will download the sdist tarballs for celery and all its dependencies to
/path/to/some/dir
(but will not install them). Then you can usepip install --no-index --find-links /path/to/some/dir/ celery
to install celery using those downloaded sdists, without accessing the network.The same process works if you replace
celery
in both commands with-r requirements.txt
, where requirements.txt is a pip requirements file listing all the packages you want (and optionally the versions you want).