MacOSX安装autopy时遇到错误
来源:互联网 发布:sai for mac下载 编辑:程序博客网 时间:2024/06/13 08:46
今天在安装autopy模块的时候遇到了无法安装的问题
最初使用easy_install autopy来安装,报错如下:
huangyuan@huangyuandeMacBook-Pro:~/Documents/Workspace/PyCharm/jd_smartcloud$ sudo easy_install autopyPassword:Searching for autopyReading http://pypi.python.org/simple/autopy/Best match: autopy 0.51Downloading https://pypi.python.org/packages/source/a/autopy/autopy-0.51.tar.gz#md5=b92055aa2a3712a9c3b4c874014b450eProcessing autopy-0.51.tar.gzRunning autopy-0.51/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3V5b4z/autopy-0.51/egg-dist-tmp-AILSheclang: 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 hereextern 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
0 0
- MacOSX安装autopy时遇到错误
- centos 安装autopy报错
- MacOSX/Ubuntu双系统安装
- MacOSX 安装ffmpeg
- macosx 上安装lua
- VMWare安装MacOSX系统
- MACOSX安装mariadb
- MacOSX安装Maven
- AutoPy教程
- Oracle安装时遇到的一个错误!
- 安装keepalived时遇到错误解决办法记录
- Yii安装srbac时遇到的错误
- 安装HeartBeat 时遇到的错误总结
- 安装scrapy时遇到的一个错误
- MATLAB安装时遇到signal_doc_en_common错误
- 安装nginx遇到错误
- [原]MacOSX x86 安装百科
- macOSX 安装 brew --- homebrew , git
- jquery 复制粘贴
- java怎么区分值传递和引用传递
- 十个经典的数据库面试问题
- StringBuffer和StringBuilder用法区别
- 类族的设计
- MacOSX安装autopy时遇到错误
- Cocoa2d-x 3.0 Release 版本 配置Mac
- SQLite 操作详解--SQL语法
- 大批量数据导入
- openwrt中添加自定义驱动模块
- 第 2 章 代理模式
- week 10 课上实例
- 文件路径问题
- eclipse运行myeclipse导出的项目