Getting started with Mu, a Python editor for beginners

Meet Mu, an open source editor that makes it easy for students to learn to code Python.
264 readers like this.
Woman programming

WOCinTech Chat. Modified by Opensource.com. CC BY-SA 4.0

Mu is a Python editor for beginning programmers, designed to make the learning experience more pleasant. It gives students the ability to experience success early on, which is important anytime you're learning something new.

If you have ever tried to teach young people how to program, you will immediately grasp the importance of Mu. Most programming tools are written by developers for developers and aren't well-suited for beginning programmers, regardless of their age. Mu, however, was written by a teacher for students.

Mu's origins

Mu is the brainchild of Nicholas Tollervey (who I heard speak at PyCon2018 in May). Nicholas is a classically trained musician who became interested in Python and development early in his career while working as a music teacher. He also wrote Python in Education, a free book you can download from O'Reilly.

Nicholas was looking for a simpler interface for Python programming. He wanted something without the complexity of other editors—even the IDLE3 editor that comes with Python—so he worked with Carrie Ann Philbin, director of education at the Raspberry Pi Foundation (which sponsored his work), to develop Mu.

Mu is an open source application (licensed under GNU GPLv3) written in Python. It was originally developed to work with the Micro:bit mini-computer, but feedback and requests from other teachers spurred him to rewrite Mu into a generic Python editor.

Inspired by music

Nicholas' inspiration for Mu came from his approach to teaching music. He wondered what would happen if we taught programming the way we teach music and immediately saw the disconnect. Unlike with programming, we don't have music boot camps and we don't learn to play an instrument from a book on, say, how to play the flute.

Nicholas says, Mu "aims to be the real thing," because no one can learn Python in 30 minutes. As he developed Mu, he worked with teachers, observed coding clubs, and watched secondary school students as they worked with Python. He found that less is more and keeping things simple improves the finished product's functionality. Mu is only about 3,000 lines of code, Nicholas says.

Using Mu

To try it out, download Mu and follow the easy installation instructions for Linux, Windows, and Mac OS. If, like me, you want to install it on Raspberry Pi, enter the following in the terminal:

$ sudo apt-get update
$ sudo apt-get install mu

Launch Mu from the Programming menu. Then you'll have a choice about how you will use Mu.

Select how to run Mu

I chose Python 3, which launches an environment to write code; the Python shell is directly below, which allows you to see the code execution.

Write Python code in Mu

The menu is very simple to use and understand, which achieves Mu's purpose—making coding easy for beginning programmers.

Tutorials and other resources are available on the Mu users' website. On the site, you can also see names of some of the volunteers who helped develop Mu. If you would like to become one of them and contribute to Mu's development, you are most welcome.

User profile image.
Educator, entrepreneur, open source advocate, life long learner, Python teacher. M.A. in Educational Psychology, M.S. Ed. in Educational Leadership, Linux system administrator.

5 Comments

I get the following error on MX Linux, based on Debian Stretch & antiX:
Collecting pyqt5==5.11.2 (from mu-editor)
Could not find a version that satisfies the requirement pyqt5==5.11.2 (from mu-editor) (from versions: )
No matching distribution found for pyqt5==5.11.2 (from mu-editor)

Where might I find this particular version for Debian Stretch?
Regards.

I installed mu-editor on Slackware 14.2/Xfce4 which appeared to work. But when I try to run it I get:

ImportError: /usr/lib64/python3.6/site-packages/PyQt5/QtCore.so: undefined symbol: PySlice_AdjustIndices

Slackware has both python 2.7.15 and 3.6.0 installed. But the path above looks good to me. What else do I need to look for?

Just in case someone stumbles over this, the solution is to go to Slackbuilds and install Python 3.6.5. The function PySlice_AdjustIndices was added sometime after 3.6.0, and is listed as a new feature in the 3.7 release notes. Apparently the PyQt5 developers picked up on it right away.

In reply to by Robert McConnell (not verified)

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.