从GitHub使用pip install -e时格式错误。使用#egg的价值? [英] Format error when using pip install -e from GitHub. Value of using #egg?

查看:550
本文介绍了从GitHub使用pip install -e时格式错误。使用#egg的价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下工作:

  pip install git + git://github.com/pydata/pandas@master 

但以下情况并不存在:

  pip install -e git + git://github.com/pydata/pandas@master 

错误是:

  --editable = git + git://github.com/pydata/ pandas @ master不是正确的格式;它必须有#egg =包

为什么?



另外,我读过 -e 执行以下操作:
--egg

 安装为自包含的egg文件,就像easy_install一样。 

这是什么值?这何时会有帮助? (我总是在 virtualenv 上工作,并通过 pip 来安装)

解决方案

通常,您不想将其作为.egg文件进行安装。但是,您可能会遇到一些罕见的情况。例如:


  • 它是少数需要重写内置程序包的程序包之一,并且在安装时知道如何执行作为一个.egg。对于Apple Python, readline 就是这样一个包。我不知道任何其他常见的例外情况。

  • 鸡蛋具有指向PyPI上其他鸡蛋的二进制依赖关系,可以作为PyPI上其他鸡蛋的二进制依赖关系。现在这种情况非常少见,因为它在很多重要情况下并不适用。

  • 您需要在单个文件中嵌入一个可以复制粘贴,FTP等的包从一个安装到另一个安装。

  • 您需要一个可以直接安装到站点包的另一个安装包。

  • 包是严重破坏(无论出于何种原因,您无法修复它),因此setup.py install无法正常工作,但它可以正确构建一个鸡蛋并用完一个鸡蛋。

  • ul>

    同时,如果您想使用可编辑模式,包和它所依赖的所有其他包必须与egg兼容,无论是否将它们安装为鸡蛋; pip 会为每个VCS网址添加#egg =<项目名称> ,并且它们中的任何一个不明白,它会失败。


    The following works:

    pip install git+git://github.com/pydata/pandas@master
    

    But the following doesn't:

    pip install -e git+git://github.com/pydata/pandas@master
    

    The error is:

    --editable=git+git://github.com/pydata/pandas@master is not the right format; it must have #egg=Package
    

    Why?

    Also, I read that the -e does the following: --egg

    Install as self contained egg file, like easy_install does.
    

    what is the value of this? When would this be helpful? (I always work on a virtualenv and install through pip)

    解决方案

    Generally, you don't want to install as a .egg file. However, there are a few rare cases where you might. For example:

    • It's one of a handful of packages that needs to override a built-in package, and knows how to do so when installed as a .egg. With Apple Python, readline is such a package. I don't know of any other common exceptions.
    • The egg has binary dependencies that point to other eggs on PyPI, and can serve as a binary dependency for yet other eggs on PyPI. This is pretty rare nowadays, because it doesn't actually work in many important cases.
    • You want a package embedded in a single file that you can copy-and-paste, FTP, etc. from one installation to another.
    • You want a package that you can install into another installation straight out of site-packages.
    • The package is badly broken (and you can't fix it, for whatever reason), so that setup.py install does not work, but it can properly build an egg and run out of an egg.

    Meanwhile, if you want to use editable mode, the package, and all other packages it depends on, have to be egg-compatible, whether or not you install them as eggs; pip will add #egg=<project name> to the VCS URL for each one, and if any of them don't understand that, it will fail.

    这篇关于从GitHub使用pip install -e时格式错误。使用#egg的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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