I've built my Raspberry Pi2 with Unbuntu per the instructions here. Software wise I have installed the following packages
python-pip
python-dev
mercurial
as well as the following python packages
Raspberry Pi GPIO;
sudo pip install hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
Adafruit DHT
git clone https://github.com/adafruit/Adafruit_Python_DHT.git cd Adafruit_Python_DHT sudo python setup.py install
When I try to run the Adafruit_Python_DHT/examples/simpletest.py
I use the following command. I did have to update the pin# in the script to match the pin that I used when I hooked it up.
sudo python simpletest.py
The response I get from it this is:
Traceback (most recent call last):
File "simpletest.py", line 40, in <module> humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) File "build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py", line 90, in read_retry
File "build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py", line 77, in read
File "build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2.py", line 34, in read RuntimeError: Error accessing GPIO.
Make sure program is run as root with sudo!
So I did some research and I found some information regarding the use of the /dev/mem
but I did not quite feel that this applied to my build although this is where I found a solution to install the dev version of the GPIO lib instead of the version that gets pulled from the OS repo. In my research on Adafruit's site it was clear that the library is supported on Raspbian. So I rebuilt the Pi using Raspbian and performed the same test without having to install the GPIO library and it worked fine.
So now I am stumped. I would really like to use Ubuntu as my OS for the Pi but at the same time need to be able to leverage this and presumably other similar libraries.