我尝试在Ubuntu 16.04上使用PIP升级Scipy但总是收到此错误。我不确定发生了什么。进度达到99%然后停止,并吐出此错误。
我尝试升级pip,但仍然会出现同样的错误。
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 310, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 750, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 370, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 587, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 810, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 649, in unpack_http_url
hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 871, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 595, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 563, in written_chunks
for chunk in chunks:
File "/usr/local/lib/python2.7/dist-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 552, in resp_read
decode_content=False):
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 353, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/response.py", line 310, in read
data = self._fp.read(amt)
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
).encode("utf8"),
MemoryError
答案 0 :(得分:2)
尝试使用
在安装期间禁用缓存pip install --no-cache-dir packageName
其中packageName在这种情况下为scipy
答案 1 :(得分:0)
最后一行说“MemoryError” 您使用的是虚拟环境吗?
如果是这样,环境可能需要分配更多内存。
转到播放器>管理>虚拟机设置
在此处,拖动滑块以选择要分配的更高内存值。
重新启动虚拟环境以进行更改。
我希望这有帮助!