MacOSX安装autopy时遇到错误
2014-05-20 18:53
447 查看
今天在安装autopy模块的时候遇到了无法安装的问题
最初使用easy_install autopy来安装,报错如下:
查看src/screengrab.c发现是由于OpenGL没有更新版本,存在一些已经被弃用的方法。解决办法很简单,增加的头文件即可,如下(箭头所指既为所加头文件):
再次编译报错如下:
安装libpng,下载地址
再次编译OK,安装成功!
PS:附安装编译安装方法如下:
done!
最初使用easy_install autopy来安装,报错如下:
huangyuan@huangyuandeMacBook-Pro:~/Documents/Workspace/PyCharm/jd_smartcloud$ sudo easy_install autopy Password: Searching for autopy Reading http://pypi.python.org/simple/autopy/ Best match: autopy 0.51 Downloading https://pypi.python.org/packages/source/a/autopy/autopy-0.51.tar.gz#md5=b92055aa2a3712a9c3b4c874014b450e Processing autopy-0.51.tar.gz Running autopy-0.51/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3V5b4z/autopy-0.51/egg-dist-tmp-AILShe clang: warning: argument unused during compilation: '-mno-fused-madd' clang: warning: argument unused during compilation: '-mno-fused-madd' clang: warning: argument unused during compilation: '-mno-fused-madd' clang: warning: argument unused during compilation: '-mno-fused-madd' clang: warning: argument unused during compilation: '-mno-fused-madd' src/screengrab.c:48:26: warning: implicit declaration of function 'CGDisplayBitsPerPixel' is invalid in C99 [-Wimplicit-function-declaration] bitsPerPixel = (uint8_t)CGDisplayBitsPerPixel(displayID); ^ src/screengrab.c:174:15: warning: 'kCGLPFAFullScreen' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations] attribs[0] = kCGLPFAFullScreen; ^ /System/Library/Frameworks/OpenGL.framework/Headers/CGLTypes.h:71:2: note: 'kCGLPFAFullScreen' declared here kCGLPFAFullScreen OPENGL_ENUM_DEPRECATED(10_0, 10_6) = 54, ^ src/screengrab.c:191:2: warning: 'CGLSetFullScreen' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations] CGLSetFullScreen(glContext); ^ /System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:73:17: note: 'CGLSetFullScreen' declared here extern CGLError CGLSetFullScreen(CGLContextObj ctx) OPENGL_DEPRECATED(10_0, 10_6); ^ src/screengrab.c:194:2: warning: implicit declaration of function 'glReadBuffer' is invalid in C99 [-Wimplicit-function-declaration] glReadBuffer(GL_FRONT); ^ src/screengrab.c:194:15: error: use of undeclared identifier 'GL_FRONT' glReadBuffer(GL_FRONT); ^ src/screengrab.c:197:2: warning: implicit declaration of function 'glFinish' is invalid in C99 [-Wimplicit-function-declaration] glFinish(); ^ src/screengrab.c:199:6: warning: implicit declaration of function 'glGetError' is invalid in C99 [-Wimplicit-function-declaration] if (glGetError() != GL_NO_ERROR) return NULL; ^ src/screengrab.c:199:22: error: use of undeclared identifier 'GL_NO_ERROR' if (glGetError() != GL_NO_ERROR) return NULL; ^ src/screengrab.c:207:2: warning: implicit declaration of function 'glPopClientAttrib' is invalid in C99 [-Wimplicit-function-declaration] glPopClientAttrib(); /* Clear attributes previously set. */ ^ src/screengrab.c:223:2: warning: implicit declaration of function 'glPushClientAttrib' is invalid in C99 [-Wimplicit-function-declaration] glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); ^ src/screengrab.c:223:21: error: use of undeclared identifier 'GL_CLIENT_PIXEL_STORE_BIT' glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); ^ src/screengrab.c:225:2: warning: implicit declaration of function 'glPixelStorei' is invalid in C99 [-Wimplicit-function-declaration] glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */ ^ src/screengrab.c:225:16: error: use of undeclared identifier 'GL_PACK_ALIGNMENT' glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */ ^ src/screengrab.c:226:16: error: use of undeclared identifier 'GL_PACK_ROW_LENGTH' glPixelStorei(GL_PACK_ROW_LENGTH, 0); ^ src/screengrab.c:227:16: error: use of undeclared identifier 'GL_PACK_SKIP_ROWS' glPixelStorei(GL_PACK_SKIP_ROWS, 0); ^ src/screengrab.c:228:16: error: use of undeclared identifier 'GL_PACK_SKIP_PIXELS' glPixelStorei(GL_PACK_SKIP_PIXELS, 0); ^ src/screengrab.c:235:2: warning: implicit declaration of function 'glReadPixels' is invalid in C99 [-Wimplicit-function-declaration] glReadPixels(x, y, width, height, ^ src/screengrab.c:236:30: error: use of undeclared identifier 'GL_BGRA' MMRGB_IS_BGR ? GL_BGRA : GL_RGBA, ^ src/screengrab.c:236:40: error: use of undeclared identifier 'GL_RGBA' MMRGB_IS_BGR ? GL_BGRA : GL_RGBA, ^ 10 warnings and 9 errors generated. error: Setup script exited with error: command 'cc' failed with exit status 1
查看src/screengrab.c发现是由于OpenGL没有更新版本,存在一些已经被弃用的方法。解决办法很简单,增加的头文件即可,如下(箭头所指既为所加头文件):
再次编译报错如下:
src/png_io.c:3:10: fatal error: 'png.h' file not found #include <png.h> ^ 1 error generated. error: command 'cc' failed with exit status 1
安装libpng,下载地址
再次编译OK,安装成功!
PS:附安装编译安装方法如下:
$ git clone git://github.com/msanders/autopy.git $ cd autopy $ python setup.py build # python setup.py install
done!
相关文章推荐
- 制作mac安装盘 遇到错误 sudo: /Applications/Install OS X Yosemite.app/Contents/Resources/createinstallmedia: c
- Mac OS X Lion 10.7.4上安装GTK+心得,兼谈如何解决fink的“could not determine XFree86 version number”错误。
- VMware11安装Mac OS X10.9.3提示不可恢复错误(vcpu-0) 的解决方法
- MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法
- VM中启动mac遇到的错误及解决方案--Mac.OSX.10.7(纯净OS)-VM
- Mac os x yosemite安装appium 1.2.4及运行sample成功遇到的问题
- mac下安装Brew遇到的错误记录 Warning: /usr/local/bin is not in your PATH
- VMware11安装Mac OS X10提示不可恢复错误解决
- MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法
- Mac下brew安装gitk遇到错误Error in startup script: unknown color name "lime"
- VMware11安装Mac OS X10提示不可恢复错误(vcpu-0)怎么办
- MAC OS X10.7.3安装Xcode4.2,一开始遇见未知错误
- Mac OS X中安装vtk时的错误解决
- esxi6.0 安装 Mac OS X 10.10 Yosemite 过程中遇到的问题
- 关于mac下安装Brew遇到的错误记录 Warning: /usr/local/bin is not in your PATH.
- mac OS X10.11.5安装scikit-learn后运行出现ValueError: numpy.dtype has the wrong size的错误
- 在virtualbox上安装mac os mavericks遇到Missing Bluetooth Controller Transport问题解决办法
- Mac OS X 下安装MySql遇到的问题
- 安装apache遇到的几个错误及解决办法 [error] Apache2.2: Service is already installed. (OS 1060)指定的服务未安装。 : Apache2.2
- MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法