Python 由于环境错误,无法安装程序包:[Errno 28]设备上没有剩余空间

Python 由于环境错误,无法安装程序包:[Errno 28]设备上没有剩余空间,python,spacy,Python,Spacy,我正试图安装 python -m spacy download en_vectors_web_lg 但这是一个错误: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device 我可以知道为什么会产生错误吗?是不是说我在目录中没有足够的空间来安装???很可能是试图将数据下载到您的/tmp临时位置。我猜默认设置(通常是ram的一半)太小,无法处理下载 您可以使用以下命令禁用t

我正试图安装

python -m spacy download en_vectors_web_lg
但这是一个错误:

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

我可以知道为什么会产生错误吗?是不是说我在目录中没有足够的空间来安装???

很可能是试图将数据下载到您的/tmp临时位置。我猜默认设置(通常是ram的一半)太小,无法处理下载

您可以使用以下命令禁用
tmp
装载:
systemctl mask tmp.mount
。在做这件事之前要小心并做你的研究

或者,您可以通过执行以下操作将
TMPDIR
目录设置为
/var/tmp

export TMPDIR='/var/tmp'

如上所述,您可以创建一个有足够空间的目录,比如说
/folder/address/here/
,然后运行下面的命令来安装它:

TMPDIR=/folder/address/here/ pip install --cache-dir=/folder/address/here/ --build /folder/address/here/ package-name
因为我自己的案例是升级tensorflow,所以我运行了以下程序:

TMPDIR=/folder/address/here/ pip install --upgrade --cache-dir=/folder/address/here/ --build /folder/address/here/ tensorflow

这个包的大小是631mb,所以实际上可能没有足够的空间
export-TMPDIR='/var/tmp'
也适合我。。。增加
/tmp
的大小并不能训练“sudo mount-o bind/mnt/yourbighd/tmp/tmp”,那么Windows操作系统呢?