如何指定dask用于临时文件的目录? [英] How to specify the directory that dask uses for temporary files?

查看:143
本文介绍了如何指定dask用于临时文件的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dask似乎写入/ tmp文件夹。如何更改dask用于临时文件的文件夹?

Dask seems to write to the /tmp folder. How can I change the folder that dask uses for temporary files?

推荐答案

设置 TMPDIR 可能会引起问题,因为它可能还会影响其他应用程序。另一种方法是使用 dask.config.set

Setting TMPDIR could potentially cause problems as it might also effect other applications. An alternative is to use dask.config.set

>>> import dask
>>> with dask.config.set({'temporary_directory': '/path/to/tmp'}):
...     pass

您也可以添加以下行

temporary_directory: /path/to/tmp

.dask / config.yaml (在您的主目录中)配置文档

to .dask/config.yaml (in your home directory) configuration docs

这篇关于如何指定dask用于临时文件的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆