Search code examples
pythoninstallationautopy

Is autopy installable locally?


i seem to have some trouble installing autopy.h

https://github.com/msanders/autopy/#introduction

i already tried the installation via git:

$ git clone git://github.com/msanders/autopy.git
$ cd autopy
$ python setup.py build

but i get the following error:

>python setup.py build 
running build
running build_py
running build_ext
building 'color' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DUSE_X11 -I/usr/include/python2.6 -c src/autopy-color-module.c -o build/temp.linux-i686-2.6/src/autopy-color-module.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
In file included from src/autopy-color-module.c:1:
src/autopy-color-module.h:5:20: error: Python.h: No such file or directory
In file included from src/autopy-color-module.c:1:
src/autopy-color-module.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initcolor’
...
src/autopy-color-module.c:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
error: command 'gcc' failed with exit status 1

so

src/autopy-color-module.h:5:20: error: Python.h: No such file or directory

is missing. Is this because ubuntu hates me, or is it because the software is just not compilable from the git? Easy_install unfortunately needs access to /usr/local/lib/python2.6/dist-packages/ which i don't have. I was hoping to import the library locally into my code.


Solution

  • You don't have the development headers for python. Since you're on Ubuntu, just install the python-dev package:

    apt-get install python-dev