23

I just want to install pytorch, I ran this in the terminal:

pip install torch

And it displays:

Collecting torch
Killed

What is the problem?

TheGainadl
  • 523
  • 1
  • 6
  • 14

2 Answers2

73

It says your your free ram is not enough to install the package, but there is a method that you can still use it.

pip install torch --no-cache-dir
Yagiz Degirmenci
  • 16,595
  • 7
  • 65
  • 85
  • 4
    Any hints as to the rationale why ignoring the cache reduces memory usage? Naively, I would assume that the cache only controls whether you have to download the package first – Ted Brownlow Mar 02 '23 at 17:59
  • @TedBrownlow, not to store the downloaded files locally as you may not have enough memory on the device; also [this post](https://stackoverflow.com/a/45594808) has different explanations. – nbs Mar 08 '23 at 17:50
  • 1
    Aren't those points about storage rather than RAM? – Ted Brownlow Mar 08 '23 at 17:58
-3

Since your free RAM is not enough try to install it after a reboot.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 30 '23 at 06:37
  • Either improve or delete the answer – Ayush May 29 '23 at 12:37