我正在尝试更新 pandas 库,因为我制作了一些 html 文件,这些文件可以在具有来自最新版本 pandas 的功能的计算机上运行,并且当我将 html 文件上传到托管该网站的 ubuntu 服务器时,pandas 功能显然不起作用。我安装了 pip 9.0.1,当我尝试更新 pandas 时,出现以下错误(对不起,代码墙):
Collecting pandas
Downloading pandas-0.20.3-cp27-cp27mu-manylinux1_x86_64.whl (22.4MB)
99% |████████████████████████████████| 22.4MB 64.9MB/s eta
0:00:01Exception:
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 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in
build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line
380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line
620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 821,
in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 659,
in unpack_http_url
hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 882,
in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 603,
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 571,
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 560,
in resp_read
decode_content=False):
File "/usr/local/lib/python2.7/dist-
packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, 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 314, in
read
data = self._fp.read(amt)
File "/usr/local/lib/python2.7/dist-
packages/pip/_vendor/cachecontrol/filewrapper.py", line 63, in read
self._close()
File "/usr/local/lib/python2.7/dist-
packages/pip/_vendor/cachecontrol/filewrapper.py", line 50, in _close
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
最佳答案
Stackoverflow 处处都是英雄:
Did you check if you have enough space left on your server? You can try pip --no-cache-dir install --upgrade pandas. – Jan Zeiseweis
MemoryError means python has filled all RAM left (this is the only uncatchable error). You should stop processes that are heavy RAM consumers, make your update and then restart your processes. – jlandercy
我同时做了这两件事,而且效果很好,我的网站又按预期运行了!
关于python - 无法在 Ubuntu 服务器中更新 Pandas ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46236953/