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.
download command lets you download packages without installing them:
pip download -r requirements.txt
(In previous versions of pip, this was spelled
pip install --download -r requirements.txt.)
Then you can use
pip install --no-index --find-links /path/to/download/dir/ -r requirements.txt
to install those downloaded modules, without accessing the network.
If you want install python libs and their dependencies offline, finish following these steps on a machine with the same os, network connected, and python installed:
1) Create a
requirements.txt file with similar content (Note - these are the libraries you wish to download):
Flask==0.12 requests>=2.7.0 scikit-learn==0.19.1 numpy==1.14.3 pandas==0.22.0
One option for creating the requirements file is to use
pip freeze > requirements.txt. This will list all libraries in your environment. Then you can go in to
requirements.txt and remove un-needed ones.
2) Execute command
mkdir wheelhouse && pip download -r requirements.txt -d wheelhouse to download libs and their dependencies to directory
3) Copy requirements.txt into
4) Archive wheelhouse into
tar -zcf wheelhouse.tar.gz wheelhouse
wheelhouse.tar.gz to your target machine:
tar -zxf wheelhouse.tar.gz to extract the files
pip install -r wheelhouse/requirements.txt --no-index --find-links wheelhouse to install the libs and their dependencies
The series “Studies in Big Data” (SBD) publishes new developments and advances in the various areas of Big Data-quickly and with a high quality. The intent is to cover the theory, research, develo...
If you can program, you are ready to grapple with Bayesian statistics. In this book, you'll learn how to solve statistical problems using Python code instead of math formulas, using discrete probabili...
Learning to code is tremendous fun as you can get instant results, no matter how much more you have to learn. In fact, it’s such fun creating games and programs that it feels effortless once you’r...
If you’ve picked up this book, you’re probably aware of the extraordinary progress that deep learning has represented for the field of artificial intelligence in the recent past. In a mere five ye...