一般我们直接使用pip来安装网络上的包文件,如果机器没有联网,但是已经有了现成的包,应该如何呢,这个时候,可以直接使用离线包来进行安装,安装方法
pip install --help
中有这么几个参数--no-index和--find-links
--no-index 是忽略包索引(仅仅从--find-links的链接地址中去查找包)
--find-links <url> 如果指定某个机器的连接地址,就会从该地址进行查找包依赖并进行下载,如果指定的是本地的文件,则直接从本地文件夹下载
英文文档说明:
If a url or path to an html file,then parse for links to archives.If a local path or file:// url that is a directory,then look for archives in the directory listing.
命令示例 pip install --no-index --find-links=file:///C:/pip_downloads/ptipython