离线安装python&点子 [英] Offline Installation of python & pip

查看:74
本文介绍了离线安装python&点子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在服务器上安装python才能运行脚本,但服务器无法访问互联网.

I need to install python on a sever to run scripts but the server has no access to the internet.

服务器可以访问可以访问Internet *的本地网络.我想使用pip通过指定的

The server has access to a local network that has access to the internet*. I would like to use pip to manage the packages through a local network directory as specified here.

如何在离线状态下的Windows计算机上安装pip,python及其依赖项,以便可以使用上述链接中指定的pip来管理所需的软件包?

How can I install pip, python and their dependancies on a windows machine, offline so that I can use pip, as specified in the link above to manage the packages I require?

*对于清晰度:我无能力进行镜像,黑客攻击或以其他方式获取信息,以直接从Internet通过本地网络传递信息.

*For Clarity: I have no ability to mirror, hack or otherwise to get information to pass through the local network directly from the internet.

推荐答案

用于Windows的官方Python安装程序没有其他依赖项.它完全脱机运行.

The official Python installer for Windows has no other dependencies. It runs completely offline.

对于其他可能具有依赖关系的软件包(很难在Windows上安装); Christopher Gholke维护了常见的Python软件包的Windows安装程序列表.这些是自包含的msi安装程序(或whl文件).

For other packages that may have dependencies (that are difficult to install on Windows); Christopher Gholke maintains a list of Windows installers for common Python packages. These are msi installers (or whl files) that are self-contained.

它们旨在与Windows的官方Python安装程序配合使用-因为它们使用其注册表项来标识安装位置.

They are designed to work with the official Python installer for Windows - as they use its registry entries to identify the install location.

您可以下载这些文件并将其移至Windows计算机.

You can download these and move them to your Windows machine.

除了这两个之外-如果您还有其他要求,则可以使用 basket 下载软件包,然后提供该位置作为离线pip安装的来源;或创建自己的点子存储库.

Beyond those two - if you have further requirements you can use tools like basket to download packages and then provide the location as a source for offline pip installs; or create your own pip repository.

如果您决定创建本地点子存储库,最好创建一个点子 proxy (例如,参见pypicache ),这种方式仅是在请求所需的那些软件包,而不是尝试对整个奶酪店进行镜像.

If you do decide to create a local pip repository, it is better to create a pip proxy (see pypicache for example) this way you are only requesting those packages that are required, rather than trying to mirror the entire cheeseshop.

这篇关于离线安装python&点子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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