Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 28] No space left on device #5816

Closed
xuhuapeng opened this issue Sep 26, 2018 · 27 comments
Closed

[Errno 28] No space left on device #5816

xuhuapeng opened this issue Sep 26, 2018 · 27 comments
Labels
auto-locked Outdated issues that have been locked by automation resolution: no action When the resolution is to not do anything type: support User Support

Comments

@xuhuapeng
Copy link

xuhuapeng commented Sep 26, 2018

Environment
an virtual environment of python3 is created by anaconda.

  • pip version: pip 18.0
  • Python version:3.6
  • OS: linux

Description

I want to install tensorflow in my linux server, when i type

pip install   tensorflow-gpu 

the terminal shows:

  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/3f/c3/000755084b5e7b5a11df1b9166a54936075ec280b7a615cecce42973fc8b/tensorflow_gpu-1.10.1-cp36-cp36m-manylinux1_x86_64.whl (253.2MB)
    99% |############################### | 250.9MB 15.9MB/s eta 0:00:01**Could not install packages due to an EnvironmentError: [Errno 28] No space left on device**

I use df -h find that the /tmp does not have enough space .

so i change the command with --build as follows:
pip install tensorflow-gpu --build /data/vincents/

However, it gaves the same error:OSError:

Collecting tensorflow-gpu
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/3f/c3/000755084b5e7b5a11df1b9166a54936075ec280b7a615cecce42973fc8b/tensorflow_gpu-1.10.1-cp36-cp36m-manylinux1_x86_64.whl (253.2MB)
    99% |############################### | 250.9MB 54.3MB/s eta 0:00:01Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

This is means the --build option in pip didn't specify the /data/vincents/ as the unpacked path.


Edit by @pradyunsg:

Known workarounds: #5816 (comment), #5816 (comment)
See closing comment: #5816 (comment)

@daa
Copy link

daa commented Sep 27, 2018

I think following will help:

TMPDIR=/data/vincents/ pip install --cache-dir=/data/vincents/ --build /data/vincents/ tensorflow-gpu

@xuhuapeng
Copy link
Author

@daa thanks !!! I can install tf with your code !! I dont know why use this "TMPDIR=/data/vincents/" ?

@daa
Copy link

daa commented Sep 28, 2018

pip downloads files to temporary directory, environment variable TMPDIR specifies that directory, also pip puts files into cache thus --cache-dir specification, --no-cache-dir should work too. --build specifies directory where wheel will be built, so its specification is also useful.

@lega911
Copy link

lega911 commented Oct 4, 2018

the same problem, pip 18.0:

root@host:/tmp# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
root@host:/tmp# python3 get-pip.py 
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/96/06/c8ee69628191285ddddffb277bd5abdf769166e7a14b867c2a172f0175b1/setuptools-40.4.3-py2.py3-none-any.whl
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/fc/e9/05316a1eec70c2bfc1c823a259546475bd7636ba6d27ec80575da523bc34/wheel-0.32.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/usr/local/lib/python3.5/dist-packages/pip'

root@host:/tmp# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  6.1G  1.4G  83% /
...
root@host:/tmp# python3 -V
Python 3.5.2
root@host:/tmp# cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

@benoit-pierre
Copy link
Member

benoit-pierre commented Oct 4, 2018

@lega911: this does not look like the same issue, as you have plenty of free space in /tmp. What about in /usr/local/lib/python3.5/?

@lega911
Copy link

lega911 commented Oct 4, 2018

@benoit-pierre
I have only 1 mounted partition (/) (base configuration of ubuntu),
so /usr/ and other places have 1.4Gb free

@benoit-pierre
Copy link
Member

Indeed, then something really weird is happening, as pip's wheel only weight 1.3M, and decompress to about 4M...

@lega911
Copy link

lega911 commented Oct 4, 2018

on Ubuntu 16.04.5 works well with the same python
on Ubuntu 16.04.2 this bug, there is no problem with free space (I can add and remove 100Mb files), no problems with access, because it's root

so it can be a bug in some library pip relied on (which was fixed in last version)

@benoit-pierre
Copy link
Member

Well, pip vendors its own dependencies, so aside from a bug in Python... I don't see any related update to Python 3.5 in the changelogs for 16.04.3, 16.04.4, or 16.04.5.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Dec 14, 2018
@drogus
Copy link

drogus commented Dec 14, 2018

I have the same problems on Arch linux:

$ "/usr/bin/virtualenv2" "-p" "/usr/bin/python2.7" "--system-site-packages" "/home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv"
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python2.7
Not overwriting existing python script /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python (you must use /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python2.7)
Installing setuptools, pip, wheel...
  Complete output from command /home/drogus/tmp/yao...ualenv/bin/python2.7 - setuptools pip wheel:
  Looking in links: /usr/lib/python2.7/site-packages, /usr/lib/python2.7/site-packages/virtualenv_support
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 2343, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 947, in create_environment
    download=download,
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/drogus/tmp/yao...ualenv/bin/python2.7 - setuptools pip wheel failed with error code 1

Let me know if you need any more details (I don't use python in general, so I have no idea what else might be of use)

@lega911
Copy link

lega911 commented Dec 14, 2018

You need to check inodes: df -i, it can be 100% usage.

@drogus
Copy link

drogus commented Dec 15, 2018

I don't think that's the case:

$ df -i | grep Main
/dev/mapper/MainVolumeGroup-root  5431296 657587  4773709   13% /
/dev/mapper/MainVolumeGroup-home 21430272 569579 20860693    3% /home

$ df -h | grep Main
/dev/mapper/MainVolumeGroup-root   82G   52G   27G  67% /
/dev/mapper/MainVolumeGroup-home  321G   72G  233G  24% /home

$ "/usr/bin/virtualenv2" "-p" "/usr/bin/python2.7" "--system-site-packages" "/home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv"
Running virtualenv with interpreter /usr/bin/python2.7
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python2.7
Not overwriting existing python script /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python (you must use /home/drogus/tmp/yaourt-tmp-drogus/aur-servo-git/src/servo/python/_virtualenv/bin/python2.7)
Installing setuptools, pip, wheel...
  Complete output from command /home/drogus/tmp/yao...ualenv/bin/python2.7 - setuptools pip wheel:
  Looking in links: /usr/lib/python2.7/site-packages, /usr/lib/python2.7/site-packages/virtualenv_support
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 2343, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 947, in create_environment
    download=download,
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/drogus/tmp/yao...ualenv/bin/python2.7 - setuptools pip wheel failed with error code 1
zsh: command not found: Running


@lega911
Copy link

lega911 commented Dec 15, 2018

Maybe I thought about another case, probably this one I solved just starting my script inside of the docker with fresh ubuntu.

@drogus
Copy link

drogus commented Dec 20, 2018

Ok, sorry for that, but it seems that my problem was a legitimate case. The problem appeared when I was installing some stuff using yaourt on Arch and I've set its temp directories to the path in my home dir. Despite that it seems that something related to virtualenv needed to write to the /tmp directory and I haven't noticed that my /tmp is a tmpfs and not shared with the main partition (I only recently got back to Linux after a long break, so I didn't even realize that it's done in this way now). In any case, after clearing the /tmp dir it works correctly

@MrBermudez
Copy link

I get the same error

C:\WINDOWS\system32>pip3 list
Package Version


astor 0.8.0
numpy 1.17.0
opencv-python 4.1.0.25
pip 19.2.1
setuptools 40.8.0
six 1.12.0
wheel 0.33.4

C:\WINDOWS\system32>pip3 install --upgrade tensorflow
Collecting tensorflow
Using cached https://files.pythonhosted.org/packages/f7/08/25e47a53692c2e0dcd2211a493ddfe9007a5cd92e175d6dffa6169a0b392/tensorflow-1.14.0-cp37-cp37m-win_amd64.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device

@chrahunt
Copy link
Member

Hi @MrBermudez. Please check whether any of your drives are full or close to full. On Windows you should be able to get this info by running wmic logicaldisk get size,freespace,caption in the command prompt. The easiest thing to do is make enough space in the drive that has your temp directory (echo %TEMP% to see it), your target virtual environment, and your cache directory (should be %LOCALAPPDATA%).

@chrahunt chrahunt added the type: support User Support label Aug 11, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Aug 11, 2019
@ijoseph
Copy link

ijoseph commented Aug 12, 2019

out-of-the-box-thinking solution: clear out extra cruft in /tmp/.

@Divide-By-0
Copy link

pip install --no-cache-dir tensorflow-gpu
solved it for me.

@MrBermudez
Copy link

MrBermudez commented Aug 14, 2019 via email

@KeithWM
Copy link

KeithWM commented Sep 28, 2019

I think following will help:

TMPDIR=/data/vincents/ pip install --cache-dir=/data/vincents/ --build /data/vincents/ tensorflow-gpu

Wouldn't it be wiser to also use the environment variable in the pip command?

@mjmmx
Copy link

mjmmx commented Oct 14, 2019

Firstly, to update pip to the latest version(pip3 install --upgrade pip --user),then
TMPDIR=/home/(your hostname)/torch/ pip3 install --cache-dir=/home/(your hostname)/torch/ --build /home/(your hostname)/torch/ torch --user
eg:
TMPDIR=/home/shawn/torch/ pip3 install --cache-dir=/home/shawn/torch/ --build /home/shawn/torch/ torch --user

Result:
Collecting torch
Downloading https://files.pythonhosted.org/packages/b4/0b/9d33aef363b6728ad937643d98be713c6c25d50ce338678ad57cee6e6fd5/torch-1.3.0-cp37-cp37m-manylinux1_x86_64.whl (773.1MB)
|████████████████████████████████| 773.1MB 12kB/s
Requirement already satisfied: numpy in ./.local/lib/python3.7/site-packages (from torch) (1.16.2)
Installing collected packages: torch
Successfully installed torch-1.3.0

@mustaphaweather
Copy link

hello friends , i had the same issue , I just rebooted my computer and it worked .
I think its a problem of ram .

@isdanni
Copy link

isdanni commented Dec 19, 2019

pip install --no-cache-dir tensorflow-gpu
solved it for me.

This worked. Python3 + Ubuntu 18.04LTS.

@mhatreabhay
Copy link

I hit this error while building docker image.

DockerBuild:
�[91mERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/home/myuser/.local/lib/python3.6/site-packages/tensorflow_core/python/training/saving'

Resolved by pruning all the images that I have accumulated over several days. ~4.6GB.

@pradyunsg
Copy link
Member

Is there anything actionable here on pip's end; given that this is a fairly system-configuration-specific error?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Feb 6, 2020
@mhatreabhay
Copy link

no action. just reporting resolution on this error.

@pradyunsg
Copy link
Member

pradyunsg commented Feb 18, 2020

The only solution here is to ensure that your $TMPDIR, cache location and install location (usually in /usr/local/ or ~/) have enough space -- for downloading the archives and unpacking them for the packages to be installed.

The answer for how to do that is very system-specific and dependent on a lot of factors (such as available hardware, policies of the organization if it's an organization-owned system etc) which means we can't provide more detailed advice for users, in general.

More resources on how to deal with this kind of issue can be found by googling "linux /tmp No space left on device", such as https://www.linuxquestions.org/questions/linux-newbie-8/having-problem-with-tmp-no-space-left-on-device-error-727905/

There isn't much actionable from pip's end here -- "ensure you have enough space in $TMPDIR, pip's cache location and install location for packages, via some mechanism provided by your OS" really is the best advice we can provide in these cases. :(

I'm going to go ahead and close this issue, but if anyone has any suggestions for how to improve / provide better advice to users, please feel free to file an new issue to discuss that.

@pradyunsg pradyunsg added resolution: no action When the resolution is to not do anything and removed S: awaiting response Waiting for a response/more information labels Feb 18, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation resolution: no action When the resolution is to not do anything type: support User Support
Projects
None yet
Development

No branches or pull requests