当前位置: 首页 > 工具软件 > Boilerpipe > 使用案例 >

安装boilerpipe时发生的错误

仲孙小云
2023-12-01

安装boilerpipe的地址为:python-boilerpipe

得到以下错误:

$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 26, in <module>
    download_jars(datapath=DATAPATH)
  File "setup.py", line 21, in download_jars
    for tarinfo in tar.getmembers():
  File "F:\File\Python\lib\tarfile.py", line 1763, in getmembers
    self._load()        # all members, we first have to
  File "F:\File\Python\lib\tarfile.py", line 2350, in _load
    tarinfo = self.next()
  File "F:\File\Python\lib\tarfile.py", line 2281, in next
    self.fileobj.seek(self.offset - 1)
  File "F:\File\Python\lib\gzip.py", line 368, in seek
    return self._buffer.seek(offset, whence)
  File "F:\File\Python\lib\_compression.py", line 143, in seek
    data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset))
  File "F:\File\Python\lib\gzip.py", line 482, in read
    raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached
tgz_url

解决方案为:

将boilerpipe包中的setup.py中的tgz_url修改为:

tgz_url='https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/boilerpipe/boilerpipe-1.1.0-bin.tar.gz'

然后在对应的文件夹中运行python setup.py install 再次得到以下警告: 

$ python setup.py install
running install
running build
running build_py
running install_lib
running install_egg_info
Removing F:\File\Python\Lib\site-packages\boilerpipe-1.3.0.0-py3.7.egg-info
Writing F:\File\Python\Lib\site-packages\boilerpipe-1.3.0.0-py3.7.egg-info
F:\File\Python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

使用 python setup.py sdist进行安装:

running sdist
running check
F:\File\Python\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt, README.rst

writing manifest file 'MANIFEST'
creating boilerpipe-1.3.0.0
creating boilerpipe-1.3.0.0\src
creating boilerpipe-1.3.0.0\src\boilerpipe
creating boilerpipe-1.3.0.0\src\boilerpipe\extract
making hard links in boilerpipe-1.3.0.0...
hard linking setup.cfg -> boilerpipe-1.3.0.0
hard linking setup.py -> boilerpipe-1.3.0.0
hard linking src\boilerpipe\__init__.py -> boilerpipe-1.3.0.0\src\boilerpipe
hard linking src\boilerpipe\extract\__init__.py -> boilerpipe-1.3.0.0\src\boilerpipe\extract
creating dist
Creating tar archive
removing 'boilerpipe-1.3.0.0' (and everything under it)

再执行以下命令: pip install -e /f/File/PythonProject/python-boilerpipe 使用-e属性以及绝对路径,得到安装失败, 已存在一个boilerpipe包 验证安装成功

pip install -e /f/File/PythonProject/python-boilerpipe
Obtaining file:///F:/File/PythonProject/python-boilerpipe
Requirement already satisfied: JPype1 in f:\file\python\lib\site-packages (from boilerpipe==1.3.0.0) (0.6.3)
Requirement already satisfied: chardet in f:\file\python\lib\site-packages (from boilerpipe==1.3.0.0) (3.0.4)
Installing collected packages: boilerpipe
  Found existing installation: boilerpipe 1.3.0.0
ERROR: Cannot uninstall 'boilerpipe'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

参考资料:

https://stackoverflow.com/questions/8295644/pypi-userwarning-unknown-distribution-option-install-requires

https://github.com/ptwobrussell/Mining-the-Social-Web-2nd-Edition/issues/286

https://github.com/misja/python-boilerpipe/issues/36

https://stackoverflow.com/questions/33548865/pip-install-boilerpipe-failed-with-tarfile-readerror-empty-file

https://stackoverflow.com/questions/33548865/pip-install-boilerpipe-failed-with-tarfile-readerror-empty-file?rq=1

 

 

 类似资料: