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

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

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

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

      <tfoot id='qWxDE'></tfoot>
      1. pip 无法从 requirements.txt 安装软件包

        时间:2023-09-14
          <tbody id='k5aeK'></tbody>
        • <tfoot id='k5aeK'></tfoot>
            <bdo id='k5aeK'></bdo><ul id='k5aeK'></ul>

              1. <legend id='k5aeK'><style id='k5aeK'><dir id='k5aeK'><q id='k5aeK'></q></dir></style></legend>
              2. <small id='k5aeK'></small><noframes id='k5aeK'>

              3. <i id='k5aeK'><tr id='k5aeK'><dt id='k5aeK'><q id='k5aeK'><span id='k5aeK'><b id='k5aeK'><form id='k5aeK'><ins id='k5aeK'></ins><ul id='k5aeK'></ul><sub id='k5aeK'></sub></form><legend id='k5aeK'></legend><bdo id='k5aeK'><pre id='k5aeK'><center id='k5aeK'></center></pre></bdo></b><th id='k5aeK'></th></span></q></dt></tr></i><div id='k5aeK'><tfoot id='k5aeK'></tfoot><dl id='k5aeK'><fieldset id='k5aeK'></fieldset></dl></div>
                  本文介绍了pip 无法从 requirements.txt 安装软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用需求文件安装 python 软件.

                  I am trying to install a python software using the requirements file.

                  >> cat requirements.txt
                  Cython==0.15.1
                  numpy==1.6.1
                  distribute==0.6.24
                  logilab-astng==0.23.1logilab-common==0.57.1
                  netaddr==0.7.6
                  numexpr==2.0.1
                  ply==2.5
                  pycallgraph==0.5.1
                  pyflowtools==0.3.4.1
                  pylint==0.25.1
                  tables==2.3.1
                  wsgiref==0.1.2
                  

                  所以我创建了一个虚拟环境

                  So I create a virtual environment

                  >> mkvirtualenv parser
                  
                  (parser)
                  >> pip freeze
                  distribute==0.6.24
                  wsgiref==0.1.2
                  
                  (parser)
                  >> pip install -r requirements.txt
                  

                  ...然后我下载了包但没有安装错误:http://pastie.org/4079800

                  ... and then I packages downloaded but not installed with errors: http://pastie.org/4079800

                  (parser)
                  >> pip freeze
                  distribute==0.6.24
                  wsgiref==0.1.2
                  

                  令人惊讶的是,如果我尝试手动安装每个软件包,它们安装得很好.例如:

                  Surprisingly, if I try to manually install each package, they install just fine. For instance:

                  >> pip install numpy==1.6.1
                  
                  (parser)
                  >> pip freeze
                  distribute==0.6.24
                  wsgiref==0.1.2
                  numpy==1.6.1
                  

                  我迷路了.怎么回事?

                  PS:我正在使用 pip v1.1 和 python v2.7.2 与 virtualenvvirtualenvwrapper

                  PS: I am using pip v1.1 and python v2.7.2 with virtualenv and virtualenvwrapper

                  推荐答案

                  看起来 numexpr 包在安装时依赖于 numpy.Pip 两次通过您的要求:首先它下载所有包并运行每个包的 setup.py 以获取其元数据,然后在第二遍中安装它们.

                  It looks like the numexpr package has an install-time dependency on numpy. Pip makes two passes through your requirements: first it downloads all packages and runs each one's setup.py to get its metadata, and then it installs them all in a second pass.

                  所以,numexpr 是在它的 setup.py 中尝试从 numpy 导入,但是当 pip 第一次运行 numexpr 的 setup.py 时,它还没有安装 numpy.

                  So, numexpr is trying to import from numpy in its setup.py, but when pip first runs numexpr's setup.py, it has not yet installed numpy.

                  这也是你一个一个安装包时看不到这个错误的原因:如果你一次安装一个,numpy会在你pip install 数字表达式.

                  This is also why you don't see this error when you install the packages one by one: if you install them one at a time, numpy will be fully installed in your environment before you pip install numexpr.

                  唯一的解决方案是在运行 pip install -r requirements.txt 之前安装 pip install numpy - 你将无法在带有单个 requirements.txt 文件的单个命令.

                  The only solution is to install pip install numpy before you ever run pip install -r requirements.txt -- you won't be able to do this in a single command with a single requirements.txt file.

                  更多信息在这里:https://github.com/pypa/pip/issues/25

                  这篇关于pip 无法从 requirements.txt 安装软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  <tfoot id='KIJD1'></tfoot>
                • <legend id='KIJD1'><style id='KIJD1'><dir id='KIJD1'><q id='KIJD1'></q></dir></style></legend>

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

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

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

                          <tbody id='KIJD1'></tbody>