51

I was trying to install

python -m spacy download en_vectors_web_lg

But it was throwing error:

Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

May I know why is it creating the error ? Is it saying that I do not have enogh space in directory to install ??

Vas
  • 918
  • 1
  • 6
  • 19

7 Answers7

51

Most likely it is trying to download the data to your /tmp temporary location. My guess is that the default settings (usually half your ram) is too small to handle the download.

You can disable the tmp mount by using the following command: systemctl mask tmp.mount. Be careful and do your research before doing this.

Alternatively you can set your TMPDIR directory to /var/tmp by doing the following export TMPDIR='/var/tmp'

Albert Lee
  • 565
  • 3
  • 7
27

I had to do a system prune to make more space.

docker system prune

Note that this will "remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes." So make sure you're not blowing away anything you need.

kenecaswell
  • 7,212
  • 1
  • 24
  • 19
  • You may want to do docker system prune -a – Gilbert May 29 '22 at 08:03
  • lol! "`Total reclaimed space: 21.32GB`" This sorted it for me. +1 :) – Chris Adams Jul 21 '22 at 11:23
  • Yup this worked for me too I ran ```sudo docker system prune -a``` And the Total reclaimed space: 3.585GB For folks running docker on their machine i think this is the first thing to try before going for other options because docker if left unchecked can be a real space eater. Don't forget to add the ```-a``` flag so all unused images not just dangling ones are removed. P.S: This command does NOT affect your volume. But to be extra careful u can backup your db before running it – i-wizard Jun 20 '23 at 05:36
24

As it is mentioned here, you can create a directory where you have enough space, say /folder/address/here/, and run below command to install it:

TMPDIR=/folder/address/here/ pip install --cache-dir=$TMPDIR --build $TMPDIR package-name

Since my own case was upgrading tensorflow, I ran this:

TMPDIR=/folder/address/here/ pip install --upgrade --cache-dir=$TMPDIR --build $TMPDIR tensorflow
James Hirschorn
  • 7,032
  • 5
  • 45
  • 53
am.rez
  • 876
  • 2
  • 12
  • 24
4

If you are working on a docker container I would advise to figure out why your docker is full, and then empty whatever is taking up space.

To figure out what is taking up the space run:

docker system df

After that run:

docker <container/image/builder> prune --all

to clean whatever takes up all the space.

Shlomo Koppel
  • 885
  • 7
  • 14
1

If you are using Ubuntu, you could also try

sudo apt-get clean

This will clear your package cache. After this try installing the package(worked for me).

0

The above methods did not work on my Linux Ubuntu computer.

The solution that finally worked was:

  1. Reboot the computer

  2. Rename /tmp as old.tmp and create a new /tmp folder. This idea came from this post, and the command was below:

    mv /tmp /old.tmp mkdir /tmp chmod 1777 /tmp

I suppose that the problem was too many files in the /tmp folder.

Note that when rebooting the computer that has too many files in the /tmp folder, the computer might get stuck. To get around this issue, this post is useful. Briefly speaking, editing the reboot option and change 'ro ...' to 'rw init=/bin/bash' so you will quickly see a bash terminal when rebooting.

Huanfa Chen
  • 577
  • 6
  • 15
0

For the those nervous at the command line and using Windows or MacOS, launch Docker Desktop. Look at Images. That will show you a list of all the images including their status. The status Unused (dangling) is probably all you want to get rid of. Just select and delete.

Why would I recommend the GUI approach? Because docker prune "remove's all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes." and that isn't necessarily what you want esp. when you're new at this. For example, Unused means Not Currently In Use At the Moment and not no longer useful or not ever going to be used again as you might expect when you're starting with Docker.

MikeB2019x
  • 823
  • 8
  • 23