Home/Support/Support Forum/ValueError: incompatible .mpy file

ValueError: incompatible .mpy file

0 votes
Hello,

I am following the Digi Micropython Programming guide documentation to setup my development environment with PyCharm IDE and the Digi XBee plugin.

The setup works great and I was able to create a project, add some code and have the IDE flash the connected module.
However when the code runs, I get the following error on the terminal:

MicroPython v1.11-1227-g52e306b on 2019-07-10; XBee3 Zigbee with EFR32MG
Type "help()" for more information.
>>>
Loading /flash/main.mpy...
ValueError: incompatible .mpy file

If I download the same code directly from the terminal using (CTRL+F / CRTL+D) and then run it using CTRL+R
then it executes the mpy just fine.

I am using PyCharm version 2019.1.3 and Xbee plugin Version 1.0.1 (June 2019). The Xbee3 Zigbee module I am using is on f/w 1007

I am suspecting that the plugin is using a version of the cross-compiler that is not compatible with the micropython installed on the module, but I have no idea how/where I can change the cross-compiler.

Any help is appreciated. The PyCharm IDE + Plugin is quite amazing to use and this is really the only problem right now to get a full development environment setup.

Thanks,
Amir.
asked Jul 22 in MicroPython by amirna2 New to the Community (1 point)

Please log in or register to answer this question.

3 Answers

+1 vote
Hi Amir,

Thanks for reporting this issue. As you say, there is a mismatch between the cross-compiler and MicroPython versions. We are fixing the problem and will release a new version of the plugin very soon.

In the meantime, you can disable the source compilation to avoid this problem. To do so, go to File | Settings | Project: <name> | XBee MicroPython and uncheck the "Compile source files with 'mpy-cross'" option.

We apologize for the inconvenience.

Best regards,
Ruben
answered Jul 24 by rmoral New to the Community (12 points)
0 votes
This error occurs when importing a module that is stored as a mpy binary file (rather than a py text file) that was generated by a different version of CircuitPython than the one its being loaded into. Most versions are compatible but, rarely they aren't.
answered Jul 29 by shruthijothsana New to the Community (3 points)
0 votes
ValueError: Incompatible .mpy file.
This error occurs when importing a module that is stored as a mpy binary file (rather than a py text file) that was generated by a different version of CircuitPython than the one its being loaded into. Most versions are compatible but, rarely they aren't.This may help:
https://docsbay.net/troubleshooting
answered Aug 21 by shruthijothsana New to the Community (3 points)
...