ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
摘要:指定路径安装miniconda和相关虚拟环境,重新设置缓存位置
1.安装miniconda,跳过,注意安装位置选择你需要安装的位置
默认conda是安装在/home/user/miniconda3位置,为了避免存储空间不够,重新安装一个miniconda到新的磁盘。
创建虚拟环境
conda create --prefix ./miniconda3/envs/names python=3.10 -y
2.修改PIP_CACHE_DIR和TMPDIR路径避免出现空间不足
# 在空间足够的位置创建pip_cache和temp文件夹
mkdir /path/to/new/dir/pip_cache
mkdir /path/to/new/dir/temp
# 临时设置
export PIP_CACHE_DIR=/path/to/new/dir/pip_cache
export TMPDIR=/home/path/to/new/dir/temp
# 查看设置是否成功
echo $PIP_CACHE_DIR
echo $TMPDIR
# 永久设置
echo "export PIP_CACHE_DIR=/path/to/new/dir/pip_cache" >> ~/.bashrc
echo "export TMPDIR=/path/to/new/dir/pip_cache" >> ~/.bashrc
source ~/.bashrc
参考:
https://stackoverflow.com/questions/74515846/error-could-not-install-packages-due-to-an-oserror-errno-28-no-space-left-on
https://blog.csdn.net/qq_29604371/article/details/135834400

浙公网安备 33010602011771号