<legend id='tR8VR'><style id='tR8VR'><dir id='tR8VR'><q id='tR8VR'></q></dir></style></legend>

    1. <i id='tR8VR'><tr id='tR8VR'><dt id='tR8VR'><q id='tR8VR'><span id='tR8VR'><b id='tR8VR'><form id='tR8VR'><ins id='tR8VR'></ins><ul id='tR8VR'></ul><sub id='tR8VR'></sub></form><legend id='tR8VR'></legend><bdo id='tR8VR'><pre id='tR8VR'><center id='tR8VR'></center></pre></bdo></b><th id='tR8VR'></th></span></q></dt></tr></i><div id='tR8VR'><tfoot id='tR8VR'></tfoot><dl id='tR8VR'><fieldset id='tR8VR'></fieldset></dl></div>
        <bdo id='tR8VR'></bdo><ul id='tR8VR'></ul>
    2. <tfoot id='tR8VR'></tfoot>

    3. <small id='tR8VR'></small><noframes id='tR8VR'>

      检查要求是否是最新的

      时间:2023-09-13

          <bdo id='k5PJO'></bdo><ul id='k5PJO'></ul>

            • <i id='k5PJO'><tr id='k5PJO'><dt id='k5PJO'><q id='k5PJO'><span id='k5PJO'><b id='k5PJO'><form id='k5PJO'><ins id='k5PJO'></ins><ul id='k5PJO'></ul><sub id='k5PJO'></sub></form><legend id='k5PJO'></legend><bdo id='k5PJO'><pre id='k5PJO'><center id='k5PJO'></center></pre></bdo></b><th id='k5PJO'></th></span></q></dt></tr></i><div id='k5PJO'><tfoot id='k5PJO'></tfoot><dl id='k5PJO'><fieldset id='k5PJO'></fieldset></dl></div>
            • <tfoot id='k5PJO'></tfoot>
                <tbody id='k5PJO'></tbody>
              <legend id='k5PJO'><style id='k5PJO'><dir id='k5PJO'><q id='k5PJO'></q></dir></style></legend>

            • <small id='k5PJO'></small><noframes id='k5PJO'>

              • 本文介绍了检查要求是否是最新的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在使用 pip 需求文件 用于保存我的依赖项列表.

                I'm using pip requirements files for keeping my dependency list.

                我还尝试遵循管理依赖项的最佳实践,并在需求文件中提供精确的包版本.例如:

                I also try to follow best practices for managing dependencies and provide precise package versions inside the requirements file. For example:

                Django==1.5.1
                lxml==3.0
                

                问题是:有没有办法告诉 Python 包索引中是否有任何更新的包版本可用于 requirements.txt 中列出的包?

                The question is: Is there a way to tell that there are any newer package versions available in the Python Package Index for packages listed inside requirements.txt?

                对于这个特定的示例,当前最新的可用版本分别是 Django 和 lxml 的 1.6.2 和 3.3.4.

                For this particular example, currently latest available versions are 1.6.2 and 3.3.4 for Django and lxml respectively.

                我试过 pip install --upgrade -r requirements.txt,但它说一切都是最新的:

                I've tried pip install --upgrade -r requirements.txt, but it says that all is up-to-date:

                $ pip install --upgrade -r requirements.txt 
                Requirement already up-to-date: Django==1.5.1 ...
                

                请注意,此时我不想运行实际升级 - 我只想看看是否有可用的更新.

                Note that at this point I don't want to run an actual upgrade - I just want to see if there are any updates available.

                推荐答案

                Pip 内置了这个功能.假设你在你的 virtualenv 类型中:

                Pip has this functionality built-in. Assuming that you're inside your virtualenv type:

                $ pip list --outdated
                psycopg2 (Current: 2.5.1 Latest: 2.5.2)
                requests (Current: 2.2.0 Latest: 2.2.1)
                
                $ pip install -U psycopg2 requests
                

                之后,将下载并安装新版本的 psycopg2 和请求.那么:

                After that new versions of psycopg2 and requests will be downloaded and installed. Then:

                $ pip freeze > requirements.txt
                

                你就完成了.这不是一个命令,但优点是您不需要任何外部依赖项.

                And you are done. This is not one command but the advantage is that you don't need any external dependencies.

                这篇关于检查要求是否是最新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何使用 twine 将新版本的项目上传到 PyPI? 下一篇:如何将多个 python 文件组织到一个模块中而不像一

                相关文章

                最新文章

              • <i id='sa4wP'><tr id='sa4wP'><dt id='sa4wP'><q id='sa4wP'><span id='sa4wP'><b id='sa4wP'><form id='sa4wP'><ins id='sa4wP'></ins><ul id='sa4wP'></ul><sub id='sa4wP'></sub></form><legend id='sa4wP'></legend><bdo id='sa4wP'><pre id='sa4wP'><center id='sa4wP'></center></pre></bdo></b><th id='sa4wP'></th></span></q></dt></tr></i><div id='sa4wP'><tfoot id='sa4wP'></tfoot><dl id='sa4wP'><fieldset id='sa4wP'></fieldset></dl></div>

                <small id='sa4wP'></small><noframes id='sa4wP'>

                    <bdo id='sa4wP'></bdo><ul id='sa4wP'></ul>
                1. <tfoot id='sa4wP'></tfoot>
                  1. <legend id='sa4wP'><style id='sa4wP'><dir id='sa4wP'><q id='sa4wP'></q></dir></style></legend>