Closed Neon22 closed 3 years ago
Personally I don't like installing anything globally with pip like that, so I use a virtualenv. Then the pip command works without sudo.
In recent versions of pip, it also defaults to --user
installs, which work in your home directory, not globally, and also should not require sudo.
well its as fresh as it comes - downloaded today and without "sudo pip3 ... " it did not create directories. I have never used virtualenv - I can't comment on its workflow.
The thing about virtualenvs is that if the user is already familiar with it, then they will be able to work it out themselves, the general instructions should be simple to follow.
@Neon22 If you would like to try using virtualenv with Python3 on Ubuntu, I would recommend the installation instructions for the Django Girls workshop.
This section, http://tutorial.djangogirls.org/en/python_installation/index.html, explains how to install Python3.
This section, http://tutorial.djangogirls.org/en/django_installation/index.html, explains how to install and use virtualenv. Note: Ubuntu 14.04 specific steps.
After I have got the work done I will spend another day on it. took me a whole day to get the system runnig and the image doesn't work anyway. I have a pdf of my process but can't attach it. I have quoted it below in case its useful pretty sure Python3 was already on ubuntu1404LTS
''' Getting a Linux machine setup to build micropython for the BBC microbit Nov 2015
Initial machine setup
Compiling
'''
Sections of message with steps done by @Neon22 should be included for documentation in #124. Can we close this issue since it will be addressed in #124? Initial PR #128 was merged yesterday.
My latest data is this """ Getting a Linux machine setup to build micropython for the BBC microbit Nov 2015
Initial machine setup
Compiling
Talking to your Microbit When the Microbit is plugged into Ubuntu system it will detect that and do the work required to connect up the devices it sees.
Remote controlling the Microbit
Important side Notes: If you login using the serial terminal and use the interactive REPL on the board you will see an implicit "import microbit as *" has already occurred. This may be confusing when you start to upload files as you'll need to add "import microbit" to the head of your py files.
"""
When the Microbit is plugged into Ubuntu system it will detect that and do the work required to connect up the devices it sees.
- One of these is the disk drive aspect a. which will show up on your desktop.
- The second is the serial terminal aspect, which allows you to talk to it and see the command prompt >and interact with it.
- Finding the Microbit's serial terminal:
I've been meaning to look further at mbed-ls (https://github.com/ARMmbed/mbed-ls) to see if it can really simplify those steps - I suspect it wouldn't need much work to only identify the micro:bit, and report the disk mount point and serial port, which could be used to simplify the process a bit.
E.g. ./tools/pyboard.py /dev/ttyACM0 your_code.py Could potentially become just
./tools/pyboard.py your_code.py
.
I have no time to look further any time soon, but if anyone else wanted to then I think there's some mileage here for simplification of the process (so long as installing mbed-ls is straightforward)
The relevant lines in dmesg output are all in one adjacent block:
[50797.130181] usb-storage 2-7:1.0: USB Mass Storage device detected
[50797.130469] scsi host5: usb-storage 2-7:1.0
[50797.149522] hid-generic 0003:0D28:0204.0005: hiddev0,hidraw1: USB HID v1.00 Device [MBED MBED CMSIS-DAP] on usb-0000:00:0b.0-7/input3
[50797.151518] cdc_acm 2-7:1.1: ttyACM0: USB ACM device
[50798.134129] scsi 5:0:0:0: Direct-Access MBED DAPLINK VFS 0.1 PQ: 0 ANSI: 2
[50798.134978] sd 5:0:0:0: Attached scsi generic sg2 type 0
[50798.147487] sd 5:0:0:0: [sdb] 16512 512-byte logical blocks: (8.45 MB/8.06 MiB)
[50798.152514] sd 5:0:0:0: [sdb] Write Protect is off
[50798.152532] sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00
[50798.156222] sd 5:0:0:0: [sdb] No Caching mode page found
[50798.156237] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[50798.189175] sdb:
TTY:
SD card:
The problem is, if the user has connected other devices before and/or after, how do you know which one is yours?
It appears the (https://github.com/ARMmbed/mbed-ls) project has same issue. I.e. if you connect multiple microbits - how do you make sure the tty you're talking to is the same as the one associated with the sdcard. There is a serial number in an earlier part of the dmesg.
I think they only way you can know is by adjacency in the output file. They do not appear to be processed in parallel (but I only have one Microbit). In terms of "Is it a Microbit ?" - the MBED CMSIS-DAP identifies it as pretty much likely to be one.
The problems of an automatic tool instead of a procedure to follow....
I haven't re-checked, but I thought the mbed-ls implementation jumped through hoops to ensure that it reports the correct mapping between device, flash drive mount point and serial device. Specifically I beleive that it can cope with multiple simultaneously connected devices - if I remember correctly from when I last looked at the source it goes grubbing deep in the OS device details (possible using some of the PnP ids?) to do this - and there are implementations for all the main OS's. I believe that it deserves some further due dilligence ...
I beleive that it also digs an ID out of the html file found in the root of the mbed flash drive that will positively identify the device as a micro:bit (If you're running a recent firmware then that html file points to the mbed platform page for the device: https://developer.mbed.org/platforms/Microbit/ - the latest firmware and instructions for applying it are at the bottom of the page).
"MBED CMISS-DAP" is generic and applies to any mbed platform with the CMISS-DAP USB protocol - whilst for our users they are unlikely to have another device that identifies itself like this there may be cases where users want to attach more than one micro:bit to a single PC.
If I wasn't travelling I'd give this a bit more time right now to actually confirm my memories from when I last dug through the code.
As of c199d6bb22330cfeb76c48c8d295eb0b3dcfe8c5 the docs mention "sudo pip3 install yotta".
Following instructions in the readme. I needed to change the line
pip3 install yotta
tosudo pip3 install yotta
to get past permission to create directories under python3.4/dist-packages. After change I was able to install yotta on ubuntu14.04LTS