pip install boilerpipe失败,tarfile.ReadError:空文件

时间:2015-11-05 15:43:38

标签: python boilerpipe

我尝试通过pip安装套管,但失败了。

这是日志。

从命令python setup.py egg_info完成输出:

Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "/tmp/pip-build-J2gFYC/boilerpipe/setup.py", line 27, in <module>
    download_jars(datapath=DATAPATH)
  File "/tmp/pip-build-J2gFYC/boilerpipe/setup.py", line 21, in download_jars
    tar = tarfile.open(tgz_name, mode='r:gz')
  File "/usr/lib/python2.7/tarfile.py", line 1678, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/usr/lib/python2.7/tarfile.py", line 1727, in gzopen
    **kwargs)
  File "/usr/lib/python2.7/tarfile.py", line 1705, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib/python2.7/tarfile.py", line 1574, in __init__
    self.firstmember = self.next()
  File "/usr/lib/python2.7/tarfile.py", line 2334, in next
    raise ReadError("empty file")
tarfile.ReadError: empty file

----------------------------------------

命令&#34; python setup.py egg_info&#34;在/ tmp / pip-build-J2gFYC / boilerpipe

中出现错误代码1失败

1 个答案:

答案 0 :(得分:1)

有时候应该下载GZ文件的URL返回404.在这种情况下安装samppipe的最佳方法是:

  • git clone https://github.com/ptwobrussell/python-boilerpipe.git
  • 打开setup.py
  • 找到定义链接的行。通常,线条看起来像 tgz_url = 'https://boilerpipe.googlecode.com/files/boilerpipe-{0}-bin.tar.gz'.format(version)
  • https://code.google.com/archive/p/boilerpipe/downloads
  • 中找到有效的下载链接
  • 将其更改为包含工作网址tgz_url='https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/boilerpipe/boilerpipe-1.2.0-bin.tar.gz'