pip installboilerpipe 因 tarfile 失败。ReadError:空文件
Posted
技术标签:
【中文标题】pip installboilerpipe 因 tarfile 失败。ReadError:空文件【英文标题】:pip install boilerpipe failed with tarfile.ReadError: empty file 【发布时间】:2015-11-05 15:43:37 【问题描述】:我尝试通过 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
----------------------------------------
命令“python setup.py egg_info”在 /tmp/pip-build-J2gFYC/boilerpipe 中失败,错误代码为 1
【问题讨论】:
【参考方案1】:有时应该从哪里下载 GZ 文件的 URL 返回 404。在这种情况下安装锅炉管道的最佳方法是:
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
找到一个有效的下载链接
将其更改为包含工作 URL tgz_url='https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/boilerpipe/boilerpipe-1.2.0-bin.tar.gz'
【讨论】:
以上是关于pip installboilerpipe 因 tarfile 失败。ReadError:空文件的主要内容,如果未能解决你的问题,请参考以下文章
pip install报错Can't roll back cryptography; was not uninstalled
Windows下使用pip安装python包是报错-UnicodeDecodeError: 'ascii' codec can't decode byte 0xcb in po
pip 安装pandas报UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5错