找不到满足 pytz 要求的版本 [英] Could not find a version that satisfies the requirement pytz

查看:40
本文介绍了找不到满足 pytz 要求的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 virtualenv 中安装 pytz 时遇到问题.

I have a problem installing pytz in virtualenv.

下载/解压pytz
找不到满足 pytz 要求的版本(来自版本:2009r, 2008b, 2009f, 2008c, 2007g, 2011g, 2005m, 2011e, 2007f, 2011k, 2006e,2006e,2008c,09e,2008c,08e,2008c,08e,2008c, 2007g,2011j,2010升,2005米,2008i中,2005k,2008克,2007年c,2007i,2009升,2009r,2006j,2011k,2007年d,2006P,2009i,2009u,2007i,2009f,2010克,地址为2008h,2009a的,2007克,2011E,2006P,2012B,2010K,2005r,2007F,2009升,2009p,2008年c,2009j,2008克,2010克,2010H,2011h,2010K,2007年c,2007年d,2011D,2009升,2011C,2008A,2005米,2007k,2009n,2011D,2010o,2013b,2012H,2010E,2012c,2012d,2012F,2011n,2011B,2011j,2008年c,2012j,2007k,2009f,2009d,2010E,2010年b,2013b,2011D,2009p,地址为2008h,2005r,2009i,2009n,2009a的,2010K,2008克,2006克,2008B,2012c,2009i,2007克,2012c,2010H,2011n,2012克,2007年d,2008A,2009u,2012克,2010o,2006P,2010年b,2009u,2012d,2011k,2012F,2009a的,2007F,2011h,2010升,2009j,2011克,2009g、2009g、2005r、2011c、2012g、2009g、2012d、2009j、2010o、2007c、2010g、2006g、2009d、2010h2005k,2006j,2010年b,2009n,2011克,2011C,2012B,2009E,2009d,2011j,2007i,2012j,2010升,2009r,2012H,2010E,2009p,2008i中,2012F,2009E,2012B,2011h,2005k,2008B,2013b,2011n、2012j、2004b)
正在清理...
没有与 pytz 版本匹配的发行版

Downloading/unpacking pytz
Could not find a version that satisfies the requirement pytz (from versions: 2009r, 2008b, 2009f, 2008c, 2007g, 2011g, 2005m, 2011e, 2007f, 2011k, 2007k, 2006j, 2008h, 2008i, 2011e, 2008a, 2009e, 2006g, 2011j, 2010l, 2005m, 2008i, 2005k, 2008g, 2007c, 2007i, 2009l, 2009r, 2006j, 2011k, 2007d, 2006p, 2009i, 2009u, 2007i, 2009f, 2010g, 2008h, 2009a, 2007g, 2011e, 2006p, 2012b, 2010k, 2005r, 2007f, 2009l, 2009p, 2008c, 2009j, 2008g, 2010g, 2010h, 2011h, 2010k, 2007c, 2007d, 2011d, 2009l, 2011c, 2008a, 2005m, 2007k, 2009n, 2011d, 2010o, 2013b, 2012h, 2010e, 2012c, 2012d, 2012f, 2011n, 2011b, 2011j, 2008c, 2012j, 2007k, 2009f, 2009d, 2010e, 2010b, 2013b, 2011d, 2009p, 2008h, 2005r, 2009i, 2009n, 2009a, 2010k, 2008g, 2006g, 2008b, 2012c, 2009i, 2007g, 2012c, 2010h, 2011n, 2012g, 2007d, 2008a, 2009u, 2012g, 2010o, 2006p, 2010b, 2009u, 2012d, 2011k, 2012f, 2009a, 2007f, 2011h, 2010l, 2009j, 2011g, 2009g, 2009g, 2005r, 2011c, 2012g, 2009g, 2012d, 2009j, 2010o, 2007c, 2010g, 2006g, 2009d, 2010h, 2005k, 2006j, 2010b, 2009n, 2011g, 2011c, 2012b, 2009e, 2009d, 2011j, 2007i, 2012j, 2010l, 2009r, 2012h, 2010e, 2009p, 2008i, 2012f, 2009e, 2012b, 2011h, 2005k, 2008b, 2013b, 2011n, 2012j, 2004b)
Cleaning up...
No distributions matching the version for pytz

好像是最新版本的pip有问题.

It seems like it's a problem with the latest version of pip.

有什么解决办法吗?

推荐答案

使用 pip v1.4 或更新版本安装 pytz 时发生此错误,原因是此行为更改:

This error occurs when installing pytz using pip v1.4 or newer, due to this change in behaviour:

从 v1.4 开始,pip 将只安装 PEP426 默认情况下.如果一个版本不能被解析为一个兼容的 PEP426 版本,那么它被假定为预发布.

Pre-release Versions

Starting with v1.4, pip will only install stable versions as specified by PEP426 by default. If a version cannot be parsed as a compliant PEP426 version then it is assumed to be a pre-release.

如果需求说明符包含预发布或开发版本(例如 >=0.0.dev0),则 pip 将允许该需求的预发布和开发版本.这不包括 != 标志.

If a Requirement specifier includes a pre-release or development version (e.g. >=0.0.dev0) then pip will allow pre-release and development versions for that requirement. This does not include the != flag.

pip install 命令还支持 --pre 标志,用于安装预发布和开发版本.

The pip install command also supports a --pre flag that will enable installing pre-releases and development releases.

pytz 包的版本标识符具有类似 2013b 的格式.PEP426 使用 PEP440,它指定:

The version identifiers for the pytz package have a format like 2013b. PEP426 uses the version identifiers described in PEP440, which specifies that:

公共版本标识符必须符合以下方案:

Public version identifiers MUST comply with the following scheme:

N[.N]+[{a|b|c|rc}N][.postN][.devN]

因为像 2013b 这样的 pytz 版本不匹配这种格式,pip 1.4+ 版本正在处理 pytz 的 所有 版本 作为预发布版本,默认情况下不会安装它们.

Because the pytz versions like 2013b do not match this format, version 1.4+ of pip is treating all versions of pytz as pre-release versions, and is not installing them by default.

如果你只安装 pytz,你可以使用 --pre 标志来避免这种行为,但你不会想使用这个标志来安装你的整个项目的要求:某些软件包可能具有您不想要的不稳定的预发布版本.在这种情况下,请使用上述行为:如果您为包指定预发布"版本号,则 pip 将搜索包的预发布"版本.所以我把它添加到了我的 requirements.txt 中:

If you are only installing pytz, you can use the --pre flag to avoid this behaviour, but you wouldn't want to use this flag for installing your entire project's requirements: some packages might have unstable pre-release versions you don't want. In that case, use the behaviour described above: if you specify a "pre-release" version number for the package, then pip will search for "pre-release" versions of the package. So I've added this to my requirements.txt:

pytz>=2013b

当我升级我的软件包时,pip 现在可以正确搜索并安装 pytz 的最新版本.

When I upgrade my packages, pip will now correctly search for and install the latest version of pytz.

这已在 pytz 错误跟踪器中作为 issue #1204837 提交pip 错误跟踪器中的问题 #974.

This has been filed as issue #1204837 in the pytz bug tracker and issue #974 in the pip bug tracker.

停止按下:如PyTz 错误报告中所述a>,现在pytz的版本号已经改成例如2013.7了——所以升级到这个以后应该不会再出现这个问题了.

Stop Press: As described in the PyTz bug report, the version numbering of pytz has now been changed to, for example, 2013.7 - so once you have upgraded to this, the problem should no longer occur.

这篇关于找不到满足 pytz 要求的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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