找不到可用的临时目录 [英] No usable temporary directory found
本文介绍了找不到可用的临时目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试找到一个临时目录, 但是当我尝试使用
I am trying to find a temp directory , but when i am trying to get the directory using
tempfile.gettempdir()
给我错误
File "/usr/lib/python2.6/tempfile.py", line 254, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/lib/python2.6/tempfile.py", line 201, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/openerp/openerp-server']
该目录的权限是root拥有的777.
The permission on the directory is 777 owned by root.
推荐答案
这种错误在两种情况下发生
This kind of error occured in two case
- 权限(应为drwxrwxrwt,并应具有根权限)
- 空间
要检查空间(磁盘使用情况),只需在终端上运行命令
To check space(disk usage)just run the command on terminal
df -h
将列出unix上的磁盘使用情况,并得到类似
Will list the disk usage on unix and get the output like
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 28G 15G 12G 58% /
如果根目录(安装在/上)的使用率为100%.
If the root(mounted on /) usage is 100%.
您需要清理tmp目录或重新启动计算机,或在根目录上腾出一些空间.
You need to clean the tmp directory or restart the machine or make some space on the root.
这篇关于找不到可用的临时目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文