Python's pip offline dependency package download and installation

If you need to download Python dependencies and install them offline without a network connection

Once you enter the cmd command line to package

1 Packaging a single module

pip download pytest -d /tmp

2 Pack all the packages of this machine

pip freeze >requirements.txt
pip download -r requirements.txt -d ./tmp

Batch installation of exported packages

pip install --no-index --find-links=./tmp -r .\requirements.txt

Guess you like

Origin blog.csdn.net/dreams_dream/article/details/131845586