use tmpfile from stdlib

use tempfile stdlib to simplify the install method