python - autopy 可以在本地安装吗?

标签 python installation autopy

我似乎在安装 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: error: Python.h: No such file or directory

不见了。这是因为 ubuntu 讨厌我,还是因为软件不能从 git 编译?不幸的是,Easy_install 需要访问我没有的 /usr/local/lib/python2.6/dist-packages/。我希望将库本地导入到我的代码中。

最佳答案

您没有 python 的开发头文件。由于您使用的是 Ubuntu,只需安装 python-dev 包:

apt-get install python-dev

关于python - autopy 可以在本地安装吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11018595/

相关文章:

ios - 在 opencv ios 中检测 C & CXX 编译器错误

python - 将 PIL 图像转换为自动复制位图?(以及返回)

python - 我可以使用 Scikit learn 和 autopy 来玩电子游戏吗?

python - 如何防止 xml.ElementTree fromstring 删除 commentnode

python - 错误: command 'cc' failed with exit status 1 on Mac for pip install MySQL-python

php - 在命令行上使用 EASYPHP DEVSERVER 访问 mySQL

sdk - Windows SDK 10 找不到 .pcp 文件

python - 为什么这行代码会产生 TypeError : 'tuple' object cannot be interpreted as an integer

python - Length-1数组可以转换为python标量错误? Python

Python - 使用 Txt 文件数据绘制图形