<tfoot id='11fHJ'></tfoot>

    <small id='11fHJ'></small><noframes id='11fHJ'>

    <legend id='11fHJ'><style id='11fHJ'><dir id='11fHJ'><q id='11fHJ'></q></dir></style></legend>

    1. <i id='11fHJ'><tr id='11fHJ'><dt id='11fHJ'><q id='11fHJ'><span id='11fHJ'><b id='11fHJ'><form id='11fHJ'><ins id='11fHJ'></ins><ul id='11fHJ'></ul><sub id='11fHJ'></sub></form><legend id='11fHJ'></legend><bdo id='11fHJ'><pre id='11fHJ'><center id='11fHJ'></center></pre></bdo></b><th id='11fHJ'></th></span></q></dt></tr></i><div id='11fHJ'><tfoot id='11fHJ'></tfoot><dl id='11fHJ'><fieldset id='11fHJ'></fieldset></dl></div>
        <bdo id='11fHJ'></bdo><ul id='11fHJ'></ul>
    2. 具有冲突依赖项的 Python 包

      Python packages with conflicting dependencies(具有冲突依赖项的 Python 包)
      <tfoot id='uLqs1'></tfoot>

          <tbody id='uLqs1'></tbody>

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

            • <bdo id='uLqs1'></bdo><ul id='uLqs1'></ul>
                <legend id='uLqs1'><style id='uLqs1'><dir id='uLqs1'><q id='uLqs1'></q></dir></style></legend>
                <i id='uLqs1'><tr id='uLqs1'><dt id='uLqs1'><q id='uLqs1'><span id='uLqs1'><b id='uLqs1'><form id='uLqs1'><ins id='uLqs1'></ins><ul id='uLqs1'></ul><sub id='uLqs1'></sub></form><legend id='uLqs1'></legend><bdo id='uLqs1'><pre id='uLqs1'><center id='uLqs1'></center></pre></bdo></b><th id='uLqs1'></th></span></q></dt></tr></i><div id='uLqs1'><tfoot id='uLqs1'></tfoot><dl id='uLqs1'><fieldset id='uLqs1'></fieldset></dl></div>
                本文介绍了具有冲突依赖项的 Python 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我们正在尝试安装几个自己编写的 python3 应用程序,它们共享一些版本冲突的库.

                we are trying to install several own written python3 applications sharing some libraries with conflicting versions.

                我们目前正在讨论在 PYTHONPATH 和/或 pythons virtualenv 中使用包的顺序.

                We are currently discussing employing the order of packages inside the PYTHONPATH and/ or pythons virtualenv.

                你会怎么处理?

                推荐答案

                你可以使用pipx.

                pipx 将为每个应用程序设置单独的虚拟环境,以便所有应用程序的依赖项保持独立.

                pipx will do all the work of setting up separate virtual environments for each application, so that all the applications' dependencies remain separate.

                如果您自己使用 virtualenv,则必须切换环境以运行不同的应用程序.pipx 为您处理环境,因此您根本不必弄乱 virtualenvs.

                If you use virtualenv yourself, you have to switch environments to run a different application. pipx handles the environment for you, so you don't have to mess with the virtualenvs at all.

                来自文档:

                pipx 专为应用程序安装而设计,因为它增加了隔离性,但仍使应用程序在您的 shell 中可用:pipx 为每个应用程序及其关联的包创建一个隔离的环境.

                pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.

                旧答案(pipsi 不再维护,但 pipx 的用法几乎相同)

                您可以使用 pipsi.

                pipsi 将为每个应用程序设置单独的虚拟环境,以便所有应用程序的依赖项保持独立.

                pipsi will do all the work of setting up separate virtual environments for each application, so that all the applications' dependencies remain separate.

                如果您自己使用 virtualenv,则必须切换环境以运行不同的应用程序.pipsi 为您处理环境,因此您根本不必弄乱 virtualenvs.

                If you use virtualenv yourself, you have to switch environments to run a different application. pipsi handles the environment for you, so you don't have to mess with the virtualenvs at all.

                来自文档:

                如果您要全局安装 Python 包以进行 cli 访问,您几乎可以肯定要使用 pipsi 而不是运行 sudo pip .... 所以你得到的

                If you are installing Python packages globally for cli access, you almost certainly want to use pipsi instead of running sudo pip .... so that you get

                • 隔离的依赖关系保证没有版本冲突
                • 无需使用 sudo 即可全局安装软件包的能力
                • 能够在不影响的情况下卸载包及其依赖项其他全局安装的 Python 程序

                这篇关于具有冲突依赖项的 Python 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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% 就足够了)

                  <bdo id='oBtYE'></bdo><ul id='oBtYE'></ul>
                    • <legend id='oBtYE'><style id='oBtYE'><dir id='oBtYE'><q id='oBtYE'></q></dir></style></legend>
                      <tfoot id='oBtYE'></tfoot>

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

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

                            <tbody id='oBtYE'></tbody>