godot-python icon indicating copy to clipboard operation
godot-python copied to clipboard

Use Godot file api to import python modules

Open touilleMan opened this issue 7 years ago • 3 comments

This is needed for #78: once exported all game resources (including python modules/packages) are packed in a single zip archive (e.g. my_game.pck), this way python interpreter crash when trying to import something which is in this archive.

Two solutions:

  • add a hook to os.open to fallback to godot file api when regular open fails.
  • add a hook on __import__ to fallback when ModuleNotFoundError is raised

touilleMan avatar Apr 07 '18 17:04 touilleMan

Any progress on this? I can't run an exported project because the python interpreter itself is hidden away in the pck - inflating file size but can't be used :(

Zireael07 avatar Sep 16 '18 15:09 Zireael07

Idon't think I'd be able to do that but by curiosity ... What should we modify to make those enhancements? Your Sources or the Godot sources?

fuderiki avatar May 17 '19 16:05 fuderiki

@fuderiki this is a change to be done on Godot-Python side, dealing with the import system of python specifically

touilleMan avatar May 18 '19 10:05 touilleMan