Python如何下载包及其依赖然后离线安装

下载包及其依赖

pip download -d <download path> <package name> -i <image site address>
# Example
pip download -d /home/PythonPackages/pefile pefile -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

离线安装包

pip install --no-index --find-links=<download path> <package name>
# Example
pip install --no-index --find-links=/home/PythonPackages/pefile pefile
posted @ 2024-12-09 15:34  ComputerPlayerJs  阅读(8)  评论(0编辑  收藏  举报