0

I am using Oracle VM for ubuntu and trying to install a python package called 'torch'. However, whenever I try to install the package by typing 'pip install torch', it gives me an error message saying 'MemoryError' at the end. The exact error message is as follow:

pip install torch

Collecting torch Downloading https://files.pythonhosted.org/packages/31/ca/dd2c64f8ab5e7985c4af6e62da933849293906edcdb70dac679c93477733/torch-1.0.1.post2-cp36-cp36m-manylinux1_x86_64.whl (582.5MB) 99% |████████████████████████████████| 582.5MB 16.4MB/s eta 0:00:01Exception:

Traceback (most recent call last): File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 176, in main status = self.run(options, args) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 315, in run resolver.resolve(requirement_set) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/resolve.py", line 131, in resolve self._resolve_one(requirement_set, req) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for self.require_hashes File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 334, in prepare_linked_requirement progress_bar=self.progress_bar File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 878, in unpack_url progress_bar=progress_bar File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 702, in unpack_http_url progress_bar) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 946, in _download_http_url _download_url(resp, link, content_file, hashes, progress_bar) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 639, in _download_url hashes.check_against_chunks(downloaded_chunks) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/utils/hashes.py", line 62, in check_against_chunks for chunk in chunks: File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 607, in written_chunks for chunk in chunks: File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/utils/ui.py", line 159, in iter for x in it: File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_internal/download.py", line 596, in resp_read decode_content=False): File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 494, in stream data = self.read(amt=amt, decode_content=decode_content) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 442, in read data = self._fp.read(amt) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 65, in read self._close() File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 52, in _close self.callback(self.__buf.getvalue()) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/controller.py", line 300, in cache_response cache_url, self.serializer.dumps(request, response, body=body) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/serialize.py", line 72, in dumps return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)]) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/__init.py", line 47, in packb return Packer(**kwargs).pack(o) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 854, in pack self._pack(obj) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 845, in _pack nest_limit - 1) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 947, in _pack_map_pairs self._pack(v, nest_limit - 1) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 845, in _pack nest_limit - 1) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 947, in _pack_map_pairs self._pack(v, nest_limit - 1) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/pip/_vendor/msgpack/fallback.py", line 790, in _pack return self._buffer.write(obj) MemoryError

So I assumed that my memory disk size for ubuntu VM is low so i installed GParted to allocate more memory. But it turns out that I still have unused memory of 1.47GiB on my dev/sda1 partition and the size of package is much smaller than that. Is there any solution for this problem? If you need any additional information please let me know. Thanks for reading.

0

"Memory" in this case means RAM, not disk space. So you'll need to change the amount of RAM allocated to your VM.

Also, the compressed size of the package is 582.5MB, which will at least double when you install it, so it sounds like you might be running out of disk space as well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.