Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 17:37
    carlosperate synchronize #1272
  • 17:37

    carlosperate on py39

    Add Python 3.9 support. Update PyQt5 dependencies. (compare)

  • 16:55
    carlosperate commented #2234
  • 16:45
    carlosperate commented #1926
  • 13:12
    carlosperate transferred #2244
  • 12:53
    kumkumbello opened #2244
  • 10:35
    drdec99 opened #2243
  • 09:13
    carlosperate commented #2242
  • 08:31
    carlosperate commented #2242
  • May 23 22:36
    carlosperate labeled #2242
  • May 23 22:36
    carlosperate milestoned #2242
  • May 23 22:36
    carlosperate commented #2242
  • May 23 22:34
    carlosperate review_requested #66
  • May 23 22:34
    carlosperate opened #66
  • May 23 22:19

    carlosperate on crash-repo

    Update crash report URL to use … (compare)

  • May 23 22:01

    carlosperate on crash-repo


  • May 23 21:58
    carlosperate edited #2242
  • May 23 21:55
    carlosperate opened #2242
  • May 23 14:22
    carlosperate synchronize #2237
  • May 23 14:22

    carlosperate on isolate-jupyter-creation

    venv: Use -I flag to isolate Ju… (compare)

I have exactly the same problem as @Bohaska. I am an experienced programmer but new to python and mu. The python script I am running has this line which fails:
from pathlib2 import Path
I have run pip3 install pathlib2 in Terminal with no errors. Can someone explain why Mu does not see pathlib2?
2017 MBP running Monterey 12.0.1
Update. I've tried running my .py script from Terminal and I get the same error: ImportError: No module named pathlib2
However, pip3 install pathlib2 runs in Terminal with no errors.
Nicholas Tollervey
Hi @mycroft47 and @Bohaska - Mu runs its own isolated version of Python (i.e. Mu comes with Python - this means beginner users of Mu don't have to go about installing a bunch of opaque technical stuff.... "It just works" :tm:). To install packages for Mu's version of Python, hit the cog icon on the bottom right and select the "third party packages" tab. Then just make sure the list of packages you need is enumerated in the text area (one package on each line). The whole process is explained here: https://codewith.mu/en/tutorials/1.1/pypi

@ntoll Thanks a lot. Problem solved. I hadn't even noticed the cog icon!

A note: in the Third Party Packages dialog, it is not immediatly clear that you can enter package names into the empty box.

Nicholas Tollervey
@mycroft47 aha... thanks for the feedback. I'll try to update the copy in the UI to make it clear. Feedback = coding fuel. ;-)
Omar Nuñez
Hello, I hope everyone you be fine, I'm new here, I came in because I have a question about Mu-editor, I try to run Mu-editor with mu-editor in terminal, but it throws me:
from PyQt5.QtCore import QTimer, Qt
ModuleNotFoundError: No module named 'PyQt5.sip'
I need help. I recently have finished the Mimo coding app for python. I wish to continue learning what mino hasn’t taught me. Any suggestions for a free learning course? Preferably for mobile devices. If you can help, thanks.
Nicholas Tollervey
@choredarck how did you install Mu..? If you're on Windows or Mac please use the "official" installers, and let us know how you get on.
@GooseTheCat8602 anything published by adafruit.com (for CircuitPython) is very good.
I have a Python script that requires command line arguments. How can I enter those arguments in Mu?
Terry King
THANKS for Mu! Running Win10, ESP32. Minor Point: When starting Mu, loading a program, clicking RUN: Mu switches to REPL but code does not run. Clicking Run again executes code. Should Mu default to starting with REPL active? I am writing stuff for Education program and looking for any "Minor Confusions" :-) I am good at finding those. Regards, Terry
Terry King

Hi Everyone, Question about RUN and "Stop".. Running Win10, ESP32. What is the best way to STOP running code?? (D id there used to be a STOP button?)

Present behavior: Code loaded in editor, REPL visible, click RUN. Code runs, REPL shows POWERON_RESET (And other setup lines), then

MPY: soft reboot
raw REPL; CTRL-B to exit


(THEN DISPLAYS any PRINT from code)

How to STOP??
I click REPL and code stops, and full editor window displayed
I click REPL again and REPL displays, showing the (POWERON_RESET ... down to >>> prompt)

Terry King
?? Can't edit that now.. Sorry! Again, I am working on supporting 100+ Total Newbies :-)
Nicholas Tollervey
@mycroft47 you should probably just run the script from the command line..? (More complicated answer = "it depends")
@TerryKing :wave: We love getting feedback and reports of problems. The "run" button behaviour you first describe is not correct. What version of Mu are you using..?
(not correct = "that's not how it's supposed to work")
Terry King
Hello Nicholas, First: many Thanks for your dedication to mu-editor! I can promise you that 100+ kids in Vermont USA will learn a lot using your work.
I am running WIN10 and mu-editor 1.1.0b7 This is ESP MicroPython Mode. Python3 Mode works great. Kids will start there.
I'd be happy to do anything I can to help now or in the future. I'm an Engineer who went Rogue at IBM and wrote code when that "Wasn't Done". I have quite a bit of Arduino and ESP32 experience and helpers who know more...
Let me know what I can do to help. Regards, Terry
Terry King
Quick Question: Mu Editor for Windows: IsIt 64 Bit ONLY?? Wondering about students with older machines...
@TerryKing: we limited our builds to 64-bit a couple of releases ago basically as a pragmatic measure. Since we ship the installers with quite a few wheels and so on, plus a static Python image, it became quite a burden. And we took the view that, by this time, even older school kit was likely to be 64-bit. It shouldn't be too difficult to build a 32-bit installer if this was an obstacle for you... assuming we can get matching wheels from the underlying libraries
Terry King

@tjguk:matrix.org : Thanks for the clear reply. Hmm.. I am working with a program that will have about 150 elementary-middle school kids with no coding experience, learning Python in an online environment : example:( https://hourofpython.trinket.io/a-visual-introduction-to-python#/welcome/an-hour-of-code) That's great to start.. But I am working on a project that bridges those kids AFTER they really learn some Python, to Python3 and MicroPython(esp32) using mu. And that trinket thing charges $3 per seat per month for Python3 and Pygame etc. OpenSourceRules!

I will try to get the first-phase of online students to tell us what their home computer hardware is. Hmm is there a good online app that will do that for an online user?? So I hope to have a better perspective on the need to a 32-bit installer. Not QuickCritical.

Thanks and let me know what you think...

Terry King
Is PortaMu still available? Thinking of locked-down school computers.
Zander Brown
PortaMU really shouldn't work on such a machine
Terry King
OK. but the HowTo for mu says: (https://codewith.mu/en/howto/1.1/use_portamu)
"Sometimes it’s not possible to install Mu because the computers you have available are locked down by somebody else.
Perhaps you find yourself running a workshop in a library or your school’s network administrator is more likely to say “get off my lawn” than “let me help you with that”. Don’t worry, thanks to the remarkable work of 14 year old Josh Lowe, you can run Mu from a pendrive (those dongle-thingamabobs for storing files that you plug into the computer’s USB port). This technique should work on both Windows and OSX.
If this is really obsolete maybe it should be removed, or labelled How NOT :-)
I need help. I am trying to create a class that can calculate the area, volume, and perimeter of a 3D object. The problem is, that I do not know how to make a class with multiple constructors, if that's possible. All help is appreciated.
import math

class Object:
    def __init__(self, x, y, z):
        self.x = x
        self.y = y
        self.z =z
        Volume = x * y * z

    def area(self):
        Area = self.x * self.z

eObject = Object
Update: fixed a bunch of rookie mistakes, including making area x * z. But it still won't work.
Urbain YANG
I can't even install mu-editor by pip.
If I follow: pip3 install mu-editor==1.1.0b7, the terminal said: Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement mu-editor==1.1.0b7
ERROR: No matching distribution found for mu-editor==1.1.0b7
If I install without the "==1.1.0b7", it will install 1.0.3. But these error message was displayed: ERROR: Could not find a version that satisfies the requirement pygame<2.0,>=1.9.2 (from pgzero)
Nicholas Tollervey
@urbainy due to complicated packaging reasons, you should install Mu using Python 3.8.
We have a load of users on old machines with old Python, and this 1.1 release family will be the last we release that they'll be able to use. Sadly, because they're on older Pythons then we can't update some of our dependencies to the latest versions, thus meaning Python 3.9+ might not work. The next version of Mu will drop support for the older Pythons and you should be able to use a newer version of Python. Hope this makes sense @urbainy -- it's all a balancing act for the different sorts of users we have.
@GooseTheCat8602 off the top of my head: you assign Area = self.x * self.z but then print(area) I think you should change Area to area and you'll get a result printed. Also, you may also want to just return area. When you instantiate the object it should look like this: eObject = Object(x=3, y=4, z=5) etc...
(or just eObject=Object(3, 4, 5))
Nicholas Tollervey
@TerryKing so,you're welcome to join the Mu developer's channel (I'll add you, please leave if you'd rather not get involved). This channel is more for support, and those of us maintaining Mu do tech discussions over in the other channel. Feel free to pick up the discussion over there. As for PortaMu - that was @JoshuaLowe1002 's thing. Josh..?
Tiago Montes
Chiming in WRT to possible future portable Mu: the pup based packaging process produces a ZIP-able directory, fully portable, that we can use going forward. Works on both macOS and Windows. It could be a matter of adjusting CI to ship those, too (modulo minor packaging fixes).
Terry King
@tmontes Said: "Chiming in WRT to possible future portable Mu: "
THANKS! I think it would be very useful for school environments and home schoolers. I would distribute it on small USB Flashdrive I think..
I have run the current release MAC version from flashdrive on a MacBook. VERY slow but it works...
In this era, installing ANYTHING is becoming a hassle. There is so much fear of malware/ransomware in the media and online discussions.
Greg Smith

@ntoll I am running Python 3.9.7 but am encountering issues much like thos reported by @urbainy.
pip3 install mu-editor==1.1.0b7
RROR: Could not find a version that satisfies the requirement mu-editor==1.1.0b7
ERROR: No matching distribution found for mu-editor==1.1.0b7
pip3 install mu-editor
RROR: Cannot install mu-editor==1.0.0, mu-editor==1.0.1, mu-editor==1.0.2 and mu-editor==1.0.3 because these package versions have conflicting dependencies.

The conflict is caused by:
mu-editor 1.0.3 depends on matplotlib==2.2.2
mu-editor 1.0.2 depends on matplotlib==2.2.2
mu-editor 1.0.1 depends on matplotlib==2.2.2
mu-editor 1.0.0 depends on matplotlib==2.2.2

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

This is with Ubuntu 21.10 64-bit, btw
Carl J. Nobile
@onshi_twitter The latest versions of MU do not run on Python 3.9, you must use 3.8 at best. On Linux, it's best to create a virtual environment so you can isolate the python version to MU.
Zack Cohen
Is there a way to stop using the ipython formatting in the Mu editor and just use standard? I was able to use it last night but since re-opening I've been locked into ipython.
e.g. "In [1]:" to ">>>"
Leon Oxer
Hi Mu friends! Is there a shortcut to switch in between the code editor and the REPL in Mu?
Terry King

Hi Everyone, (NewBieAlert) Problem with page https://codewith.mu/en/tutorials/1.1/ (Shows available tutorials)..
One tutorial is "Adafruit Boards and Mu" click and see [Adafruit make a wide variety of a...]
Another tutorial is "MicroPython on ESP" Click and.. (it goes to the Adafruit tutorial).

MinorWish: The REPL tutorial is good. There are specific examples of the button bands for Python3 and Adafruit and BBC micro:bit
It WouldBeNice if there was one for the ESP Micropython REPL. :-)

Terry King
Being one of those annoying RTFM people, I went looking for a Mu reference manual. So I find stuff like "Mu Documentation - Read the Docs" but that's just for developers. And of course "Tutorials - Code With Mu" which are good at one level.. And https://mu.readthedocs.io/en/latest/ again, for developers. Did I miss something??
I DID just get Nicholas' book "Programming With MicroPython" but I just started...
OK, sorry, I know this is still Beta but I am easily confused. I will now Read The Tollervey Book.
THANKS for all the work; Mu is a wonderful tool for teaching this stuff. Once I learn it.
Terry King
Good morning, I did a bad bad thing... I accidentally commented out the webrepl in the boot.py and now I have zero access to the files through mu to get it back... sorry for the super stupid question, but how in the world do I fix this? I can't get into my TinyPico esp32 any other way that I know of... think of me as a super basic idiot... also I'm sure this has been asked before is there a way to search the chat.
Nicholas Tollervey
@Ladybrinx assuming you've backed up the code that was already on the device, just re-flash it with the MicroPython image you originally used. Everything should be reset to a clean state. Then copy your code back onto the device.
29 replies