无需安装即可下载带有依赖项的python包 [英] Download python package with dependencies without installing

查看:64
本文介绍了无需安装即可下载带有依赖项的python包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在不安装的情况下下载一个包含所有依赖项的 python 包,将它连接到一台没有连接到互联网的计算机上,然后在那里安装.比如我要安装buildbot、lettuce等

I need to download a python package with all its dependencies without installing, sneaker-net it to a computer without connection to the internet, and install it there. For example, I want to install buildbot, lettuce, etc.

计算机是Windows 7机器,使用Python 2.7.如果包有本机扩展,我可以在计算机上构建它们.

The computer is a Windows 7 machine, using Python 2.7. If the package has native extensions, I can build them on the computer.

推荐答案

您可以使用 pip,带有 --download 选项,它将下载主包和它的依赖项,无需安装.

You can use pip, with the --download option, which will download the main package and its dependancies, without installing them.

pip install --download="/path/to/downloaded/files" sneaker-net

并在本地机器上使用这些文件:

And use these files one the local machine with:

pip install --no-index --find-links=<DIR on local machine> sneaker-net

请参阅 pip 文档--download 用于快速&本地安装.例如,您可以在带有 cygwin 的 Windows 上使用 pip.

See pip documentation --download for fast & local installs. You can use pip on Windows with cygwin for example.

这篇关于无需安装即可下载带有依赖项的python包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆