Could not install packages due to an EnvironmentError: [Errno 28] No space left on device
1. 问题现象
安装 opencv-python
时报错:
wohu@ubuntu:~$ pip2 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir --timeout=100000
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-python
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz (88.0MB)
100% |████████████████████████████████| 88.0MB 5.1MB/s
Could not install packages due to an EnvironmentError: [Errno 28] No space left on device
wohu@ubuntu:~$
2. 解决方法
原因是 /tmp
已满,可对 /tmp
重定向:
wohu@ubuntu:~$ mkdir $HOME/tmp
wohu@ubuntu:~$ echo $TMPDIR
wohu@ubuntu:~$ export TMPDIR=$HOME/tmp
wohu@ubuntu:~$ chmod -R 777 /tmp
重新安装
wohu@ubuntu:~$ pip2 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir --timeout=100000
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-python
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz (88.0MB)
100% |████████████████████████████████| 88.0MB 1.9MB/s
Installing build dependencies ... \