Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 22 20:30
    rob0621 opened #2002
  • Jan 22 20:14
    rob0621 opened #2001
  • Jan 22 02:06
    shaohaiyang opened #2000
  • Jan 21 15:03
    carlosperate labeled #1997
  • Jan 21 15:03
    carlosperate commented #1997
  • Jan 21 15:00
    carlosperate edited #1997
  • Jan 21 14:45
    carlosperate labeled #1999
  • Jan 21 14:45
    carlosperate commented #1926
  • Jan 21 14:45
    carlosperate closed #1998
  • Jan 21 14:45
    carlosperate commented #1998
  • Jan 21 14:44
    carlosperate commented #1926
  • Jan 21 14:43
    carlosperate edited #1999
  • Jan 21 11:19
    Mask3dM4n opened #1999
  • Jan 21 11:18
    Mask3dM4n opened #1998
  • Jan 21 11:07
    LukeASmith commented #1997
  • Jan 21 11:03
    LukeASmith opened #1997
  • Jan 21 09:55
    carlosperate closed #1969
  • Jan 21 09:55
    carlosperate commented #1969
  • Jan 21 04:23
    MvGulik commented #1028
  • Jan 21 02:09
    elfisho commented #1969
Patronsaintofdice
@Patronsaintofd1_twitter
I had a total newb question. I just installed Mu and running it for the first time on an older (2015) MacBook. Everything appears to be working fine, except the minus sign, "-", is a nearly invisible light gray in my editor and the interactive shell. Can someone tell me how to change the font color of this one specific character?
Carl J. Nobile
@cnobile2012
@Patronsaintofd1_twitter I have never heard of a way to change the font color of a specific character on any platform Windoze, Mac, or Linux. However, you can probably change the font itself to one that doesn't have this issue, or maybe just change the pitch (size).
Bohaska
@Bohaska
I'm using Mu to learn Python. How do you install modules that you have installed from the command line? The import command gives a ModuleNotFoundError
Carl J. Nobile
@cnobile2012
@Bohaska It depends on what platform you are on and how MU was installed on that platform. However, in your situation, it seems that you have installed the packages in a different environment than MU was installed. Soooo, we need more info. Mac, Windows, or Linux?
Bohaska
@Bohaska
I'm on mac
1 reply
@cnobile2012
mycroft47
@mycroft47
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
mycroft47
@mycroft47
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
@ntoll
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
mycroft47
@mycroft47

@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
@ntoll
@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
@choredarck
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'
Goose
@GooseTheCat8602
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
@ntoll
@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.
mycroft47
@mycroft47
I have a Python script that requires command line arguments. How can I enter those arguments in Mu?
Terry King
@TerryKing
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
@TerryKing

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

>OK

(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
@TerryKing
?? Can't edit that now.. Sorry! Again, I am working on supporting 100+ Total Newbies :-)
Nicholas Tollervey
@ntoll
@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
@TerryKing
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
@TerryKing
Quick Question: Mu Editor for Windows: IsIt 64 Bit ONLY?? Wondering about students with older machines...
tjguk
@tjguk:matrix.org
[m]
@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
@TerryKing

@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
@TerryKing
Is PortaMu still available? Thinking of locked-down school computers.
Zander Brown
@zbrown:matrix.org
[m]
PortaMU really shouldn't work on such a machine
Terry King
@TerryKing
OK. but the HowTo for mu says: (https://codewith.mu/en/howto/1.1/use_portamu)
--(copy)--
"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.
--(end)--
If this is really obsolete maybe it should be removed, or labelled How NOT :-)
Goose
@GooseTheCat8602
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
        print(Volume)

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

eObject = Object
Goose
@GooseTheCat8602
Update: fixed a bunch of rookie mistakes, including making area x * z. But it still won't work.
Urbain YANG
@urbainy
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
@ntoll
@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
@ntoll
@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
@tmontes
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
@TerryKing
@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
@onshi_twitter

@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
@cnobile2012
@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
@ZCohen39_twitter
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 ">>>"