Skip to content
import in memory, with the interface the same as zipimport.
C Python
Branch: master
Clone or download
zyobi add readme.
Latest commit 3b381b7 Jun 8, 2014
Type Name Latest commit message Commit time
Failed to load latest commit information.
memzipimport.c fixed memory error. Jun 8, 2014 initial commit. Jun 7, 2014


This module is mostly the same like the builtin module zipimport. While zipimport imports from a zip file, and memzipimport imports from zipped content in memory.


import sys
sys.memzip = {"": bytearray(open("", "rb").read())}
sys.path.insert(0, "")
sys.path_hooks.insert(0, memzipimport.zipimporter)

There are three steps:

  • store zipped content in sys.memzip as an bytearray
  • insert a virtual library path
  • insert path hooks
You can’t perform that action at this time.