bbcmicrobit / micropython

Port of MicroPython for the BBC micro:bit
https://microbit-micropython.readthedocs.io
Other
603 stars 284 forks source link

importError #608

Closed rogasb closed 5 years ago

rogasb commented 5 years ago

Using: Python 3.7.1 (v3.7.1:260ec2c36a) [MSC v.1915 32 bit (Intel)] on win32.

the both script and interactive command 'import music' produced the following.

(this error report from interactive command in PyScipter) File "C:\Users\Roger\AppData\Local\Programs\Python\Python37-32\lib\site-packages\music__init.py", line 2, in from . import utils, tables, synths, effects, structures, singing ImportError: cannot import name 'structures' from 'music' (C:\Users\Roger\AppData\Local\Programs\Python\Python37-32\lib\site-packages\music\init__.py)

module music was loaded today(28/11/2018), via pip, and then an upgrade was attempted (again via pip) inspection of the folder shows no file titled 'structures'

At my stage of learning the language I am totally stopped.

rhubarbdog commented 5 years ago

import music is a microbit micropython module. you should not be using python3 as a command to run it 1) plug a microbit into your computer

2 a) using mu which can be installed from here b) using an editor of your choice and uflash to copy your program, to a microbit c) code it live in a REPL session, instructions are here. d) use a web based editor at microbit.org. click download to convert your program to a .hex file. this can be copied to the microbits flash with file manager.

3) try the examples on readthedocs.io. navigate the site with the index on the left this will take you straight to music further reference here

rogasb commented 5 years ago

Thank you for your very comprehensive answer.

In my naivety I had assumed that all python development was intended to be multi-platform