点击ctrl-c在安装spacy时,现在在尝试再次安装时出现错误
问题描述:
我正在尝试安装spacy。我在CentOS Linux上点击ctrl-c在安装spacy时,现在在尝试再次安装时出现错误
!pip install -U spacy
在jupyter笔记本和一切工作正常。在安装过程中,我意识到我打算包含--user命令,因为我只打算为我的用户安装,所以我点击了ctrl-c。此时安装不完整。
尝试用pip再次安装软件包现在给我一个错误,无论我是否包含--user标志。我认为下面的错误与不完整的构建有关。有谁知道如何解决这一问题?
Collecting spacy
Exception:
Traceback (most recent call last):
File "/opt/anaconda2/lib/python2.7/site-packages/pip/basecommand.py", line
215, in main
status = self.run(options, args)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/commands/install.py",
line 335, in run
wb.build(autobuilding=True)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/wheel.py", line 749, in
build
self.requirement_set.prepare_files(self.finder)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
620, in _prepare_file
session=self.session, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 809,
in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 715,
in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 811, in _
RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file`
答
谢谢大家。为我工作的解决方案是转到$ HOME/.cache/pip并删除http /和wheels的内容/
当您执行作业或ps aux |时,您是否看到任何相关进程或作业? grep pip'? – JacobIRR
您也可以尝试通过设置'--no-cache-dir'标志来禁用pip缓存。 –
车轮文件可能已损坏或不完整。试试'pip install --upgrade --force-reinstall spacy' –