Unable to import frozen modules even though they show up in help('modules') #11732
-
I'm working on porting micropython v1.20.0 on a pre-existing FreeRTOS based project. I based it off the minimal port. It's running on an STM32U575 (Cortex-M33) I have the following working:
Once I started trying to do some mpy-cross and .mpy files, I started running into issues. I tried to create a frozen manifest.py with something like: module("testmod.py", base_path="modules/testmod/")
require("base64") The project compiles ok and I can see them listed when I run In the image above, base64 and testmod are frozen modules. Base64 should come from micropython-lib and testmod is just a simple python file inside the class TestMod:
def __init__(self):
self.test = 1
def print(self):
print("HELLO") device is my custom C module which is working fine. Any idea where I could be going wrong? Happy to share more details of the build, but it's a fairly complicated cmake project so I don't want to provide too much information if it's something simple I'm missing 😅 Also, if it's better not do pre-compile and there's a better way to import them, I'm all ears! I don't yet have the filesystem working, so it's all pre-compiled fun right now. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@alvarop Can you inspect the value of |
Beta Was this translation helpful? Give feedback.
@alvarop Can you inspect the value of
sys.path
. My guess is that you don't have".frozen"
in it.