pip install error: No space left on device

An error occurred when pip install xxx:

  File "/root/miniconda3/envs/new/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 622, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/root/miniconda3/envs/new/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 587, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/root/miniconda3/envs/new/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/root/miniconda3/envs/new/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 455, in _error_catcher
    raise ProtocolError("Connection broken: %r" % e, e)
pip._vendor.urllib3.exceptions.ProtocolError: ("Connection broken: OSError(28, 'No space left on device')", OSError(28, 'No space left on device'))

Reason:
There is not enough space in the build directory.
Solution:
Specify a build directory to store the cache.

pip install --cache-dir=/home/user/dirname xxx

Guess you like

Origin blog.csdn.net/weixin_43669978/article/details/132669950