[SOLVED] python-gpios-module-for-a20-olinuxino-mic

Started by Mouchon, August 23, 2013, 02:20:50 PM

Previous topic - Next topic

Mouchon

Hi
i try to install it from package
with following command:

python setup.py install

first time the CHANGES.TXT was missing.

doing a touch CHANGES.TXT resolve the problem. But after i have this

python setup.py install
running install
running build
running build_py
running build_ext
building 'A20_GPIO' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/gpio_lib.c -o build/temp.linux-armv7l-2.7/source/gpio_lib.o
source/gpio_lib.c:39:22: fatal error: gpio_lib.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1


So seem that gpio_lib.h is missing from the package too.

Mouchon

Get last version of the packages and compile and work fine.

pete_l

#2
Downloaded latest version 0.1.6 from here: https://pypi.python.org/pypi/pyA20/0.1.6

Extracted:
root: tar -xzvf pyA20-0.1.6.tar.gz
pyA20-0.1.6/
pyA20-0.1.6/CHANGES.txt
pyA20-0.1.6/PKG-INFO
pyA20-0.1.6/examples/
pyA20-0.1.6/examples/blink_led.py
pyA20-0.1.6/LICENSE.txt
pyA20-0.1.6/README.txt
pyA20-0.1.6/setup.py
pyA20-0.1.6/source/
pyA20-0.1.6/source/gpio_lib.h
pyA20-0.1.6/source/pyA20.c
pyA20-0.1.6/source/gpio_lib.c


Installed:
root: cd pyA20-0.1.6
root: python setup.py install
running install
running build
running build_py
running build_ext
building 'A20_GPIO' extension
creating build
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/gpio_lib.c -o build/temp.linux-armv7l-2.7/source/gpio_lib.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/pyA20.c -o build/temp.linux-armv7l-2.7/source/pyA20.o
source/pyA20.c:23:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1


Looks like the pre-requisite is to
apt-get install python-dev

before attempting to build this library

martinayotte

The error comes because you missing the package python-dev.

Simply execute the command "apt-get install python-dev", then redo "python setup.py install"


pete_l

Thanks, I just tried that, it works! (post updated)