Xbee 3 micropython

I am unable to use the python module math on the xbee via the Xbee plugin of pycharm.

I have created a new xbee micropython project using the Digi Xbee plugin of pycharm.
Everything works fine.

Then I wanted to use the Math module, the project builds fine because it is in the xbee library and also in the standard python modules included in the project.

But when I deploy the code to the xbee 3 module via the Digi Xbee plugin of pycharm, I do not see the math module deployed.

So the app crashes at execution time.

>>>

soft reboot
Loading /flash/main.mpy…
Running bytecode…
Traceback (most recent call last):
File “/flash/main.py”, line 2, in 
ImportError: no module named ‘math’

MicroPython v1.20.0-1893-gc1d0c0d on 2025-01-15; XBee3 Zigbee with EFR32MG
Type “help()” for more information.
>>>

How can we use the micropython math module on the xbee3 module ?

The XBee modules do not directly support the module math.

help(‘modules’)
main micropython uhashlib ustruct
ble uarray uio usys
builtins ubinascii ujson utime
digi ucryptolib umachine xbee
gc uerrno uos
Plus any modules on the filesystem

You would need to manually load the Math module.

Thanks for the reply.
Can you please guide me to do that ?
Since the micropython distribution is handled by the pycharm digi xbee plugin, I do not know how to add a single module manually.
Sorry I am kindy new to micropython.
Thanks a lot in advance.

Probably the best way is to import the file into the Lib directory of your project. Then when you compile and upload the app, it should send it to the Lib directory of the module. If that does not work, you can use the file system manager in XCTU or Studio. Then Brows to the directory you have it on your PC and drag it over to the \lib directory on the module.

Thanks again for your reply.
Should I copy the math.py file which is in /ExternalLibraries/Python3.14/BinarySkeletons/ ?
of the math.pyi which is in /ExternalLibraries/XbeeMicropython/digimicropython/ ?

Also where should I copy it ? in the Lib folder of /.venv/ ?