--use-mirrors的规范替代品 [英] Canonical replacement for --use-mirrors

查看:100
本文介绍了--use-mirrors的规范替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PyPI可能不可靠.不幸的是,我有很多Travis-CI构建失败,因为pip无法满足我的要求之一(lxml是最臭名昭著的违规者).

PyPI can be unreliable. I've had an unfortunate number of Travis-CI builds fail because pip fails to install one of my requirements (lxml is the most notorious offender).

各种在线资源推荐使用--use-mirrors标志,到目前为止,该标志已为我解决了该问题.但是,出于许多原因,--use-mirrors已弃用.

Various online resources recommend the --use-mirrors flag, which has solved the issue for me thus far. However, --use-mirrors is deprecated for a number of good reasons.

不幸的是,如链接中所述,删除标志的主要原因之一是,新的CDN支持的PyPI不应有相同的问题.是的.我的版本仍然有问题,除非使用--use-mirrors,否则我仍然无法使用pip可靠地安装软件包.

Unfortunately, as mentioned in the link, one of the primary reasons for the removal of the flag is that the new CDN backed PyPI shouldn't have the same issues. It does. I still have issues with my builds, and I still can't reliably install packages with pip unless I use --use-mirrors.

2014年1月1日的1.5版发行说明建议使用标志-i-index-url--extra-index-url之一.很好,除了...我们遇到了与--use-mirrors相同的一些问题,即这些镜像不一定是可信任的.

The release notes for release 1.5 on 2014-01-01 recommend using one of the flags -i, -index-url, or --extra-index-url. Which is great, except... We run into some of the same issues that --use-mirrors had, namely that these mirrors can't necessarily be trusted.

实际上已删除了 PyPI镜像列表,给我们留下了一些

The PyPI mirrors list has actually been removed, leaving us with some unofficial mirrors. Thus I'm left with a choice: keep using --use-mirrors and hope that one of the issues above is fixed before it is removed, or pick a mirror and hope it works and is trustworthy.

是否存在一个广为接受和信任的镜像?还是被广泛接受和信任的替代方案?基本上,我应该如何处理这个问题?

Is there a widely accepted and trusted mirror? Or a widely accepted and trusted alternative? Basically, how should I handle this problem?

推荐答案

坦白地说,我从未遇到过您所描述的问题-因此,我不知道该如何解决公共pypi索引的问题.

Frankly, I have never faced the issue that you are describing - so I do not know what to do to resolve issues with the public pypi index.

但是,作为一般惯例;我可以推荐以下内容,这是我们在部署时使用的内容(由于我们部署为无法访问Internet的系统):

However, as a general practice; I can recommend the following which is what we use when deploying (as the systems we deploy to do not have access to the Internet):

  1. 创建本地pypi镜像,然后在此处发布您的软件包.您可以通过多种方式执行此操作.使用 basket 的简单方法,或者您可以执行我们的操作并创建自己的pypi镜像(请参见: 如何滚动自己的pypi?以获取一些建议).

  1. Create a local pypi mirror, and publish your packages there. You can do this in many ways. The simple approach with basket or you can do what we did and create your own pypi mirror (see: How to roll my own pypi? for some suggestions).

使用 wheel .这就是我们要迁移的原因,因为安装过程非常简单,并且不需要依赖其他服务器.

Use wheel. This is what we are migrating to because the install process is super simple and does not require reliance on other servers.

我知道拥有一个全局pypi索引非常方便,但是作为部署构建链的一部分,我将其用作备份.因为它在我无法控制的网络上(因此它可能无法访问或不可靠);而且更重要的是,在构建过程中,我的系统可能不需要访问Internet.

I know having a global pypi index is a great convenience but as part of a deployment build-chain I would use it as a backup; for one it is on a network I do not control (hence it may be unreachable or unreliable); and more importantly my systems may not need access to the Internet during the build process.

这篇关于--use-mirrors的规范替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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