Ask coding questions

← Back to all posts
I can't install PyTorch
fcatus (1)

I tried installing it by adding it to the packages using the left menu. I have also tried poetry add torch but every time I try, it throws this error (no enough disk space). I deleted all my other repos and kept this one yet I still can't install PyTorch.

myproject$ poetry add torch
Using version ^1.9.0 for torch

Updating dependencies
Resolving dependencies... (253.4s)

Writing lock file

Package operations: 7 installs, 4 updates, 0 removals

  • Updating urllib3 (1.26.5 -> 1.26.6)
  • Updating tqdm (4.61.0 -> 4.61.1)
  • Updating typing-extensions ( ->
  • Installing huggingface-hub (0.0.12)
  • Updating numpy (1.20.3 -> 1.21.0)
  • Installing pyyaml (5.4.1)
  • Installing sacremoses (0.0.45)
  • Installing tokenizers (0.10.3)
  • Installing (1.7.3)
 • Installing torch (1.9.0): Failed


  Command ['/opt/virtualenvs/python3/bin/pip', 'install', '--no-deps', '/home/runner/.cache/pypoetry/artifacts/ac/e2/4b/36eaa7e7f48590864972659dc7f242d1584ae5b2852600746ac88f679a/torch-1.9.0-cp38-cp38-manylinux1_x86_64.whl'] errored with the following return code 1, and output: 
  Processing /home/runner/.cache/pypoetry/artifacts/ac/e2/4b/36eaa7e7f48590864972659dc7f242d1584ae5b2852600746ac88f679a/torch-1.9.0-cp38-cp38-manylinux1_x86_64.whl
  ERROR: Could not install packages due to an EnvironmentError: [Errno 122] Disk quota exceeded: '/tmp/pip-install-k1vgmm1u/torch/torch/lib/'
  WARNING: You are using pip version 19.3.1; however, version 21.1.3 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.

  at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/utils/ in _run
      1071│                 output = subprocess.check_output(
      1072│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1073│                 )
      1074│         except CalledProcessError as e:
    → 1075│             raise EnvCommandError(e, input=input_)
      1077│         return decode(output)
      1079│     def execute(self, bin, *args, **kwargs):

Failed to add packages, reverting the pyproject.toml file to its original content.
fcatus (1)

UPDATE: A temprary workaround was to install the CPU-only version of PyTorch through pip.

$ pip3 install torch==1.8.0+cpu -f
Wumi4 (541)

Maybe because PyTorch is quite big? I know that machine learning libraries like PyTorch is usually large. I once got crashed when install Tensorflow on my computer.

fcatus (1)

@Wumi4 well, that's pretty obvious. I have already mentioned in my post that this is the problem.
I am on a Hacker plan, which means I should have 5GB of storage. PyTorch IS NOT larger than 5GB...