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

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 ... \

猜你喜欢

转载自blog.csdn.net/wohu1104/article/details/112503879