【问题标题】:unable to install library from github using pip无法使用 pip 从 github 安装库
【发布时间】:2014-08-05 13:47:50
【问题描述】:

我已经分叉了this repo。我正在尝试使用pip 从我的仓库安装它,因为我做了一些更改,但它不断失败。我尝试了几件事,但没有运气:

pip install -e git+https://github.com/rshiva/python-boilerpipe.git#egg=python-boilerpipe
-e git://github.com:rshiva/python-boilerpipe.git#egg=python-boilerpipe

我得到的错误是

no matches found

为什么要提到 egg ?这样做的正确方法是什么?

【问题讨论】:

  • 我得到一个不同的错误;运行setup.py 失败,因为boilerpipe 下载无法解压缩。
  • 换句话说,您的第一个pip install 命令是完全正确的。软件包已下载并 pip 尝试 安装它,但正是该步骤失败。

标签: python python-3.x github pip


【解决方案1】:

您的第一个pip 命令行是正确的,但是安装 失败。

这是因为 repo 包含 broken copy of the boilerplate-1.2.0-bin.tar.gz filesetup.py 脚本找到此文件,不会下载新副本,但由于文件不完整,无法提取该文件:

Updating ./src/python-boilerpipe clone
Running setup.py (path:/Users/mj/Development/venvs/stackoverflow-3.4/src/python-boilerpipe/setup.py) egg_info for package python-boilerpipe
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/Users/mj/Development/venvs/stackoverflow-3.4/src/python-boilerpipe/setup.py", line 27, in <module>
    download_jars(datapath=DATAPATH)
  File "/Users/mj/Development/venvs/stackoverflow-3.4/src/python-boilerpipe/setup.py", line 22, in download_jars
    for tarinfo in tar.getmembers():
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/tarfile.py", line 1738, in getmembers
    self._load()        # all members, we first have to
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/tarfile.py", line 2311, in _load
    tarinfo = self.next()
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/tarfile.py", line 2246, in next
    self.fileobj.seek(self.offset)
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/gzip.py", line 573, in seek
    self.read(1024)
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/gzip.py", line 365, in read
    if not self._read(readsize):
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/gzip.py", line 449, in _read
    self._read_eof()
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/gzip.py", line 482, in _read_eof
    crc32, isize = struct.unpack("<II", self._read_exact(8))
  File "/Users/mj/Development/Library/buildout.python/parts/opt/lib/python3.4/gzip.py", line 286, in _read_exact
    raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached

从您的存储库中删除此文件,您的安装就可以正常工作了。

【讨论】:

  • 为了澄清其他人,只需将声明注释掉:download_jars(datapath=DATAPATH)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-10-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-05-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多