load pyd files from a zip from embedded python

前端 未结 4 1157
轻奢々
轻奢々 2021-01-12 19:09

I can load Python modules (.py, .pyc, .pyd) from a zip file by calling \"import some_module\" from a Python interpreter only after sys.path has been extended to include the

4条回答
  •  攒了一身酷
    2021-01-12 19:26

    Which version of python was memimporter.pyd (which is inside the zipextimporter) compiled for? If the python interpreter and pyd don't match you're going to get horrible crashes.

    I'm not sure where the mem importer code is, but at a guess I would think that the idea is to insert an import hook which detects a zip-based pyd import and extracts the pyd to a temporary location and call the Python interpreter's standard import on that.

提交回复
热议问题