I am having some trouble importing a certain library module from micropython-lib on to the OpenCam M7 board. I am trying to use the pipe() function that is included in the OS module of the micropython-lib. I went through the micropython documentation to learn how to download and import the modules but for some reason, it is not working. The error I keep getting is that it cant find the “pipe_” function which is located in the OS folder of micropython-lib/os/init.py.
If anyone knows how to import these libraries, can you please explain how. Or is this not possible? I am using a windows laptop with the OpenMV Cam M7.
Thank you in advance!
Hi, where did you place the module?
It needs to be like:
“/pipe/init.py”
or
“/pipe.py”
On the SD Card or flash FS.
Then in python you can do:
import pipe
The module is located under the “os” directory called “init.py”.
When I download the library module and import it into the sdcard it is like this: “/os/init.py” and I “import os”.
I know there is another import for “os” so I renamed “os” to “oslib” and imported it like that but I still get the “pipe_” error. I tried importing the modules that “init.py” imports into its own module but it still doesn’t work.
Here are some screenshots to show my setup I changed according to your procedures but I still get same error:
After running the code above, I get this error from the init.py module
Here is the module I am looking to import:
https://github.com/micropython/micropython-lib/tree/master/os/os
Do I have to import the whole “micropython-lib” library for it to work so that “/os/init.py” can work since it imports other files into its own module?
Thank you for your help!
That’s because there’s no libc to load, there are no FDs and there’s only a single process running anyway. The camera runs baremetal (it’s Not Unix/Linux based).
Oh okay I see. I am sorry I didn’t make that connection before.
Thank you for such a quick reply.
Oh, yeah, alot of the MPlib stuff is for the unix port of MicroPython.