我似乎在安装autopy.h时遇到了一些麻烦。
https://github.com/msanders/autopy/#introduction
我已经通过git尝试了安装:
$ git clone git://github.com/msanders/autopy.git
$ cd autopy
$ python setup.py build
但是我收到以下错误:
>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
所以
src / autopy-color-module.h:5:20:错误:Python.h:没有这样的文件或 目录
缺少。这是因为ubuntu讨厌我,还是因为软件无法从git中编译?不幸的是,Easy_install需要访问我没有的/usr/local/lib/python2.6/dist-packages/
。我希望将本地库导入到我的代码中。
答案 0 :(得分:5)
您没有python的开发标头。因为你在Ubuntu上,只需安装python-dev软件包:
apt-get install python-dev