Struggling to figure out how to get the right version of mpy-cross on Windows

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ceb2120
 
Posts: 10
Joined: Fri Oct 14, 2022 1:33 pm

Struggling to figure out how to get the right version of mpy-cross on Windows

Post by ceb2120 »

Good morning, please forgive that I am a bit new to Circuit Python.

I've been trying to get mpy-cross for Windows 10. When I use pip to get it from here https://pypi.org/project/mpy-cross/ it downloads version 6 and when I create the .mpy file it gives me this error

Code: Select all

MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
When I've googled it I've been pointed to this website https://adafruit-circuit-python.s3.amaz ... mpy-cross/ however when I download the files for windows (for example downloading the file mpy-cross.static-x64-windows-8.0.0-rc.1-5-g9ab0733a2) and then I run the file I don't know if it did anything. It asks me if I want to allow it to make changes to my computer, I say yes, and then it just disappears and I'm not sure if anything happened. And it didn't change anything when I attempt to use mpy-cross from the command line.

I feel a bit dumb that I can't figure this out, but I'd appreciate it if someone could help me out.

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Struggling to figure out how to get the right version of mpy-cross on Windows

Post by danhalbert »

The mpy-cross in pypi is for MicroPython, but it's not obvious immediately.

You got the right thing from S3. mpy-cross has not changed in a long time (it will change for 9.0.0 due to changes we will merge from MicroPython).

It's a very quiet program, and you need to run it from the command line. Give it one or more .py files, and it will silently create (or replace) the corresponding .mpy files.

It might have looked like it didn't change anything, but it should have worked. I just tried it on Windows. I create a test.py file, ran it, and it created test.mpy.

User avatar
ceb2120
 
Posts: 10
Joined: Fri Oct 14, 2022 1:33 pm

Re: Struggling to figure out how to get the right version of mpy-cross on Windows

Post by ceb2120 »

Thank you for your response. What command are you using for it to work?

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Struggling to figure out how to get the right version of mpy-cross on Windows

Post by danhalbert »

I am using https://adafruit-circuit-python.s3.amaz ... 0-rc.1.exe

In a PowerShell window (you could use CMD too), I just ran

Code: Select all

mpy-cross.static-x64-windows-8.0.0-rc.1.exe test.py
It created test.mpy in the same directory.

You don't need the absolute latest. It is the same.

User avatar
ceb2120
 
Posts: 10
Joined: Fri Oct 14, 2022 1:33 pm

Re: Struggling to figure out how to get the right version of mpy-cross on Windows

Post by ceb2120 »

Thank you! I didn't realize you needed the full file name in there. I was able to get it to work now, I appreciate it!

User avatar
danhalbert
 
Posts: 4613
Joined: Tue Aug 08, 2017 12:37 pm

Re: Struggling to figure out how to get the right version of mpy-cross on Windows

Post by danhalbert »

Glad it's working. You can rename it if you think it's too long. Or use the tab key to complete :) .

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”