默认解压到当前目录 import shutil shutil.unpack_archive('/root/redis-3.2.3.tar.gz') 解压到home目录下 import shutil shutil.unpack_archive('/root/redis-3.2.3.tar.gz','/home/')