2012-10-20 16 views
7

Hey ho guardato e vecchia questione qui, ma non risponde alla mia domandaerrori durante l'installazione di python autopy

Ho installato libpng, tentare di installare autopy e ottenere gli errori complie.

Non sono molto bravo con Python, quindi non sono sicuro su come risolverli.

Ashley:~ ashleyhughes$ sudo easy_install autopy 
Searching for autopy 
Reading http://pypi.python.org/simple/autopy/ 
Reading http://www.autopy.org 
Best match: autopy 0.51 
Downloading http://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-U9uWoj/autopy-0.51/egg-dist-tmp-hdjtIx 
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:191:2: warning: 'CGLSetFullScreen' is deprecated 
     [-Wdeprecated-declarations] 
     CGLSetFullScreen(glContext); 
     ^
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, 
              ^
9 warnings and 9 errors generated. 
error: Setup script exited with error: command 'clang' failed with exit status 1 

Qualcuno può aiutare. Ho bisogno autopy come si lavora su più piattaforme

ho usato ethan.tira-thompson.com/Mac_OS_X_Ports.html installare libpng

Avete Xcode installato con strumenti a linea di comando come pure

+0

Basta [modifica] la tua domanda per aggiungere le informazioni extra. –

+1

Sembra che manchino i file di intestazione OpenGL. Hai installato Xcode? –

+0

Sì, ho anche xcode dovuto installare gli strumenti della riga di comando xcode in quanto mancava clang –

risposta

-3

Se avete provato questo:

$ sudo easy_install autopy

Un'altra opzione è quella di compilare dalle ultime sorgente sul repository GitHub:

$ git clone git: //github.com/msanders/autopy.git

$ cd autopy

$ python setup.py costruire

$ python setup.py install

Quando costruendo dal sorgente, assicuratevi di escludere dalla directory autopy prima di provare ad usare AutoPy altrimenti potrebbe fallire su un ImportError a causa delle importazioni relative di Python.

+0

Ho provato entrambi i precedenti due errori –

11

Ho avuto lo stesso problema, se si nota tutti i 9 errori sono provenienti da un unico file: src/screengrab.c Questo file non è stato aggiornato alla versione più recente di OpenGL e ci sono metodi deprecati. Sul autopy GitHub repo c'è un bug segnalato per questo here. La correzione/trucco suggerito che c'è da aggiungere la riga: #include <OpenGL/gl.h>

dopo la linea 7 in src/screengrab.c. Dovrai ottenere il sorgente da Github e modificarlo localmente piuttosto che usare easy_install.
Nota: questo è un trucco che verrà compilato, ma lo schermo sarà tutto nero. Qualcuno deve passare qualche minuto a riscrivere screengrab.c con metodi aggiornati.

3

quando ho aggiunto

#include <OpenGL/gl.h> 

Non ha compilato.

Così, ho preso uno sguardo anche se il mio hard disk, alla ricerca di ogni gl.h

Così, ho provato

#include "/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h" 

Poi sono riuscito a compilarlo :-)

Problemi correlati