I am trying to find a temp directory , but when i am trying to get the directory using
tempfile.gettempdir()
it\'s giving me error of
I ran into this issue earlier today. I started a query embedded in jupyter before going to lunch, and I returned to jupyter throwing some type of error (can't remember what it was exactly). When I tried restarting jupyter in the terminal, I got the error described in OP's question (no usable temporary directory). The answers above didn't work, so I tried restarting my entire VM, at which point I got the error described here. After following the instructions in that thread's top answer, the problem was resolved.
Problem can also occur if inode are full.
You can type df -i
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 253841 322 253519 1% /dev
tmpfs 255838 430 255408 1% /run
/dev/xvda1 5120000 5120000 0 100% /
tmpfs 255838 1 255837 1% /dev/shm
tmpfs 255838 7 255831 1% /run/lock
tmpfs 255838 16 255822 1% /sys/fs/cgroup
tmpfs 255838 4 255834 1% /run/user/1000
I had the same problem while running a python script in Docker. The following command fixed it for me:
docker rmi $(docker images --quiet --filter "dangling=true")