How to install pip on the mangOH-red


#1

Hello,

I would like to install pip on the mango red so that I can add python packages on the mangOH.
I can’t modify anything into the root, the system prints the following message : “read-only file system” even if I am super administrator. I can’t either realize a chmod for the same reasons. This prevents me from installing anything directly in the /usr/lib/python2.7

Do you have any tips to change that or install pip?
Thank you


#2

The root filesystem is a squashfs (or ubifs), neither of which are really amenable to being read/write.

The Legato filesystem overlay is read-write so you could put it in there, but it is quite small. What I’m doing is using an SD card for my read-write during development.

First, I rebuilt the Yocto kernel to include ext4 support (not sure why that isn’t included by default). Then I used another Linux system to format the card and mount that filesystem on /tmp/sdcard (I haven’t yet figured out how to add a directory to Yocto; I’m sure that’s trivial, I just haven’t figured out the magic). Then you can install Pip onto the SD card and adjust your PYTHONPATH accordingly. You can adjust the default directory that Pip installs into: http://pip.readthedocs.io/en/stable/user_guide/#configuration

I chose to go a bit further and used debootstrap (which I had to modify since it relies on Perl) to build an entire Debian armel chroot environment on my SD card so I can now build directly on the module. Of course, I can do Pip (or apt) inside Debian.