This is a cache of https://discuss.96boards.org/t/installing-mraa-for-using-with-python3/2050. It is a snapshot of the page at 2024-10-31T11:53:54.551+0000.
Installing mraa for using with Python3 - DragonBoard410c - 96Boards Forum

Installing mraa for using with Python3

Hi,

As it appears that mraa is the preferred GPIO library so I’ve tried to install it on my Dragonboard.

I’ve found a number of different documented ways of install it for 96boards. Sadly none of them seems to have worked for me.

linaro@linaro-alip:~$ sudo python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[gcc 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mraa
>>> mraa.Gpio(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'mraa' has no attribute 'Gpio'
>>> 

What is the primarily supported installation method?
Is it from source? Is there a Debian package? Is it there by default or do I have to add a new repository?

Thanks in advance,
Barry

I have been following the build instructions in the mraa repository which are at:

My issue was with a missing build dependancy for python3. I needed python3-dev e.g:

sudo apt-get install git build-essential swig3.0 python3-dev nodejs-dev cmake libjson-c-dev

Not python-dev as documented:

sudo apt-get install git build-essential swig3.0 python-dev nodejs-dev cmake libjson-c-dev

Hey did you solve this issue by changing to python3-dev? I tried installing using sudo apt-get install python3-dev but it didn’t work for me

It solved my issue for Python3 usage on the kernel at the time.I would suggest you open a new issue specifying your OS and kernel along with the error messages you are getting.