I’m using MacBook and Operating System is MacOS Sierra.
I use this command to install autopy:
JavaScript
x
2
1
sudo pip install autopy
2
But i get this error:
JavaScript
1
93
93
1
Collecting autopy
2
Downloading autopy-0.51.tar.gz (74kB)
3
100% |████████████████████████████████| 81kB 256kB/s
4
Installing collected packages: autopy
5
Running setup.py install for autopy error
6
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-jSobWR/autopy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-lxk785-record/install-record.txt --single-version-externally-managed --compile:
7
running install
8
running build
9
running build_py
10
creating build
11
creating build/lib.macosx-10.12-intel-2.7
12
creating build/lib.macosx-10.12-intel-2.7/autopy
13
copying autopy/__init__.py -> build/lib.macosx-10.12-intel-2.7/autopy
14
running build_ext
15
building 'color' extension
16
creating build/temp.macosx-10.12-intel-2.7
17
creating build/temp.macosx-10.12-intel-2.7/src
18
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/autopy-color-module.c -o build/temp.macosx-10.12-intel-2.7/src/autopy-color-module.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
19
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MMBitmap.c -o build/temp.macosx-10.12-intel-2.7/src/MMBitmap.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
20
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/autopy-color-module.o build/temp.macosx-10.12-intel-2.7/src/MMBitmap.o -o build/lib.macosx-10.12-intel-2.7/autopy/color.so
21
building 'screen' extension
22
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/autopy-screen-module.c -o build/temp.macosx-10.12-intel-2.7/src/autopy-screen-module.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
23
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/screen.c -o build/temp.macosx-10.12-intel-2.7/src/screen.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
24
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DNDEBUG=1 -DMM_LITTLE_ENDIAN -DIS_MACOSX -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/screengrab.c -o build/temp.macosx-10.12-intel-2.7/src/screengrab.o -Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wshadow
25
src/screengrab.c:48:26: warning: implicit declaration of function 'CGDisplayBitsPerPixel' is invalid in C99 [-Wimplicit-function-declaration]
26
bitsPerPixel = (uint8_t)CGDisplayBitsPerPixel(displayID);
27
^
28
src/screengrab.c:174:15: warning: 'kCGLPFAFullScreen' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
29
attribs[0] = kCGLPFAFullScreen;
30
^
31
/System/Library/Frameworks/OpenGL.framework/Headers/CGLTypes.h:98:2: note: 'kCGLPFAFullScreen' has been explicitly marked deprecated here
32
kCGLPFAFullScreen OPENGL_ENUM_DEPRECATED(10_0, 10_6) = 54,
33
^
34
src/screengrab.c:191:2: warning: 'CGLSetFullScreen' is deprecated: first deprecated in macOS 10.6 [-Wdeprecated-declarations]
35
CGLSetFullScreen(glContext);
36
^
37
/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:73:17: note: 'CGLSetFullScreen' has been explicitly marked deprecated here
38
extern CGLError CGLSetFullScreen(CGLContextObj ctx) OPENGL_DEPRECATED(10_0, 10_6);
39
^
40
src/screengrab.c:194:2: warning: implicit declaration of function 'glReadBuffer' is invalid in C99 [-Wimplicit-function-declaration]
41
glReadBuffer(GL_FRONT);
42
^
43
src/screengrab.c:194:15: error: use of undeclared identifier 'GL_FRONT'
44
glReadBuffer(GL_FRONT);
45
^
46
src/screengrab.c:197:2: warning: implicit declaration of function 'glFinish' is invalid in C99 [-Wimplicit-function-declaration]
47
glFinish();
48
^
49
src/screengrab.c:199:6: warning: implicit declaration of function 'glGetError' is invalid in C99 [-Wimplicit-function-declaration]
50
if (glGetError() != GL_NO_ERROR) return NULL;
51
^
52
src/screengrab.c:199:22: error: use of undeclared identifier 'GL_NO_ERROR'
53
if (glGetError() != GL_NO_ERROR) return NULL;
54
^
55
src/screengrab.c:207:2: warning: implicit declaration of function 'glPopClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
56
glPopClientAttrib(); /* Clear attributes previously set. */
57
^
58
src/screengrab.c:223:2: warning: implicit declaration of function 'glPushClientAttrib' is invalid in C99 [-Wimplicit-function-declaration]
59
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
60
^
61
src/screengrab.c:223:21: error: use of undeclared identifier 'GL_CLIENT_PIXEL_STORE_BIT'
62
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
63
^
64
src/screengrab.c:225:2: warning: implicit declaration of function 'glPixelStorei' is invalid in C99 [-Wimplicit-function-declaration]
65
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
66
^
67
src/screengrab.c:225:16: error: use of undeclared identifier 'GL_PACK_ALIGNMENT'
68
glPixelStorei(GL_PACK_ALIGNMENT, BYTE_ALIGN); /* Force alignment. */
69
^
70
src/screengrab.c:226:16: error: use of undeclared identifier 'GL_PACK_ROW_LENGTH'
71
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
72
^
73
src/screengrab.c:227:16: error: use of undeclared identifier 'GL_PACK_SKIP_ROWS'
74
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
75
^
76
src/screengrab.c:228:16: error: use of undeclared identifier 'GL_PACK_SKIP_PIXELS'
77
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
78
^
79
src/screengrab.c:235:2: warning: implicit declaration of function 'glReadPixels' is invalid in C99 [-Wimplicit-function-declaration]
80
glReadPixels(x, y, width, height,
81
^
82
src/screengrab.c:236:30: error: use of undeclared identifier 'GL_BGRA'
83
MMRGB_IS_BGR ? GL_BGRA : GL_RGBA,
84
^
85
src/screengrab.c:240:15: error: use of undeclared identifier 'GL_UNSIGNED_INT_8_8_8_8_REV'
86
GL_UNSIGNED_INT_8_8_8_8_REV, /* Native format */
87
^
88
10 warnings and 9 errors generated.
89
error: command 'cc' failed with exit status 1
90
91
----------------------------------------
92
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-jSobWR/autopy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-lxk785-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-jSobWR/autopy/
93
Why am i getting this error?
Advertisement
Answer
There is a known issue that for some reason wasn’t fixed.
Issue: https://github.com/msanders/autopy/issues/75
It contains following workaround (commands to type in console):
JavaScript
1
3
1
brew install libpng
2
CFLAGS="-Wno-return-type" pip install git+https://github.com/potpath/autopy.git
3