I'm trying to run pip install tensorflow
from a jupyter notebook (trying to run it with cmd gives out an even stranger error), and my free disk space (currently 1.2 GB left) seems to dwindle during installation and then I'm presented with [Errno 28] No space left on device
. Then it goes back to what it was.

- 479
- 2
- 8
- 14
3 Answers
This will certainly help using pip install and build:
pip install --cache-dir=/data/jimit/ --build /data/jimit/ tensorflow-gpu TMPDIR==/data/jimit/
What it does is:
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.
Please Note: /data/jimit are directory so please name it according to your preferences.

- 768
- 1
- 8
- 31
-
I get `'TMPDIR' is not recognized as an internal or external command, operable program or batch file.` – chocojunkie Aug 14 '20 at 10:53
-
@chocojunkie I updated the code, run the code now in your command prompt with administrator privileges or from your IDE. – Jimit Vaghela Aug 14 '20 at 11:01
-
Also do the `pip install --upgrade pip` before running that. – Jimit Vaghela Aug 14 '20 at 11:02
-
@chocojunkie If it helped, please mark this answer as accepted, it'd help others decide too and help me gain reputation. Thank you. – Jimit Vaghela Aug 16 '20 at 18:27
Wanting to import it myself to a ML PyCharm project, I googled and run across the same issue. Using pip it will cost your disk 1.1 GB approx. So, if you have 1.2 GB size left in your disk, it makes sense that the installation stucks.
If you are familiar with the functions/classes of the tensorflow package, I'd recommend to install certain libraries. For example in an IDE - in your import section - you can use:
from tensorflow import test
That way, only test needed packages from tensorflow platform will be installed
Or using the answer from Jimit you can pip certain packages using the parameters. For further information regarding the use of pip you can also take a look here: https://pip.pypa.io/en/stable/cli/pip_install/

- 333
- 1
- 6
- 15
Jimit's answer didn't work for me. Instead I had to follow this example, which mentions:
export TMPDIR='/work/tmp_other'; python3 -m pip install gooey
Which would change Jimit's answer to this:
export TMPDIR='/data/jimit/'; pip install --cache-dir=/data/jimit/ tensorflow-gpu
where /data/jimit/
is a custom directory.

- 71,951
- 46
- 188
- 305