Reputation: 185
I need to install tensorflow on my Raspberry, but executing pip install tensorflow
(or any other pip install
) ends up with a Errno 28 "No space left on device".
I tried solution 2 of this with no effect, this but it says it's deprecated, and even this.
I understand the problem lies in the fact that I don't have enough space in the directory where the unpacking occurs (the first one below) because when I use df
it produces this (sorry headers are in french) :
I even tried to export TMPDIR=PATH_TO_A_BIGGER_ONE
but it still can't complete the download because of no space.
I just can't find a way to change this directory.
Upvotes: 10
Views: 18366
Reputation: 11
I was following this guide and ran into the same problem you describe. These steps solved it for me:
Create a temp folder on a disk that has a lot of space:
mkdir -p /bigtempfolder
Change TMPDIR env to the big folder you just created:
export TMPDIR=/bigtempfolder
Set generous access to the temp folder:
sudo chmod 777 /bigtempfolder
(Create a Swap file if you have limited RAM on the machine):
Create a Swap of 4 GB:
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
Format the file for Swap usage:
sudo mkswap /swapfile
Activate Swap file:
sudo swapon /swapfile
Make the Swap permanent:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Verify that the swap is now activated:
sudo swapon --show
Install the package(s) using the --cache-dir
flag:
pip --cache-dir /bigtempfolder install tensorflow
Upvotes: 0
Reputation: 4655
Both TMPDIR and Target directory should be big enough.
TMPDIR=PATH_TO_A_BIGGER_ONE pip install [package name] --target ANOTHER_PATH_TO_A_BIGGER_ONE
Upvotes: 20