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

        • <bdo id='V3iEA'></bdo><ul id='V3iEA'></ul>

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

        pip 需求文件中的可选依赖项

        Optional dependencies in a pip requirements file(pip 需求文件中的可选依赖项)
        • <small id='dBb1Y'></small><noframes id='dBb1Y'>

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

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

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

              • <tfoot id='dBb1Y'></tfoot>
                  本文介绍了pip 需求文件中的可选依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 pip 需求文件中指定可选依赖项?

                  How can I specify optional dependencies in a pip requirements file?

                  根据 pip 文档,这是可能的,但文档没有解释如何这样做,我在网上找不到任何例子.

                  According to the pip documentation this is possible, but the documentation doesn't explain how to do it, and I can't find any examples on the web.

                  推荐答案

                  你可以创建一个optional-requirements.txt和一个<代码>requirements.txt.

                  Instead of specifying optional dependencies in the same file as the hard requirements, you can create a optional-requirements.txt and a requirements.txt.

                  要将当前环境的包导出到文本文件中,您可以这样做:

                  To export your current environment's packages into a text file, you can do this:

                  pip freeze > requirements.txt
                  

                  如有必要,修改 requirements.txt 的内容以准确表示您项目的依赖项.然后,要安装此文件中的所有包,请运行:

                  If necessary, modify the contents of the requirements.txt to accurately represent your project's dependencies. Then, to install all the packages in this file, run:

                  pip install -U -r requirements.txt
                  

                  -U 告诉 pip 将包升级到最新版本,-r 告诉它安装 requirements.txt 中的所有包.

                  -U tells pip to upgrade packages to the latest version, and -r tells it to install all packages in requirements.txt.

                  这篇关于pip 需求文件中的可选依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  env: python: No such file or directory(env: python: 没有这样的文件或目录)
                  How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                  Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                  Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                  Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                  When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)

                1. <small id='FOA4S'></small><noframes id='FOA4S'>

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

                            <tbody id='FOA4S'></tbody>

                          <tfoot id='FOA4S'></tfoot>