2012-10-20 12 views
7
स्थापित करने

अरे मैं यहाँ पर और पुराने सवाल ध्यान दिया है, लेकिन यह मेरे सवालकरते समय त्रुटियां अजगर autopy

मैं स्थापित किया है libpng उत्तर नहीं मिलता है तो autopy स्थापित करने और complie त्रुटियों प्राप्त करने की कोशिश।

मैं अभी तक पाइथन में बहुत अच्छा नहीं हूं इसलिए मुझे यकीन नहीं है कि उन्हें कैसे ठीक किया जाए।

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 

कोई भी मदद कर सकता है। मैं autopy की जरूरत के रूप में यह कई प्लेटफार्मों

मैं libpng

xcode कमांड लाइन औजार के रूप में अच्छी तरह से

+0

बस [संपादित करें] यह संकलन करने में कामयाब अतिरिक्त जानकारी जोड़ने के लिए अपना खुद का सवाल। –

+1

आपको ओपनजीएल हेडर फाइलें याद आ रही हैं। क्या आपने एक्सकोड स्थापित किया था? –

+0

हाँ मेरे पास xcode भी xcode कमांडलाइन उपकरण स्थापित करना था क्योंकि क्लैंग –

उत्तर

-3

के साथ स्थापित किया है स्थापित करने के लिए इस्तेमाल किया ethan.tira-thompson.com/Mac_OS_X_Ports.html पर काम करता है आप की कोशिश की है, तो इस:

$ sudo easy_install autopy

एक अन्य विकल्प GitHub भंडार के बारे में नवीनतम स्रोत से संकलित करने के लिए है:

$ Git Git क्लोन: //github.com/msanders/autopy.git

$ सीडी autopy

$ अजगर setup.py

$ अजगर का निर्माण स्थापित setup.py

जब स्रोत से निर्माण, ऑटोपी का उपयोग करने से पहले ऑटोपी निर्देशिका से बाहर निकलना सुनिश्चित करें या अन्यथा यह पाइथन के सापेक्ष आयात के कारण आयात त्रुटि पर असफल हो सकता है।

+0

मैंने उपर्युक्त दोनों की कोशिश की है दोनों ने एक ही त्रुटि दी है –

11

मैं एक ही समस्या थी, अगर आप सभी 9 त्रुटियों एक फ़ाइल से आ रहे हैं नोटिस: src/screengrab.c इस फ़ाइल ओपन के नवीनतम संस्करण में अद्यतन नहीं किया गया है और वहाँ पदावनत तरीके हैं। autopy GitHub रेपो पर एक बग इस here. सुधार के लिए सूचना दी है/हैक सुझाव वहाँ लाइन को जोड़ने के लिए है: #include <OpenGL/gl.h>

src/screengrab.c में लाइन 7 के बाद। आपको गिटूब से स्रोत प्राप्त करना होगा और easy_install का उपयोग करने के बजाय स्थानीय रूप से इसे बदलना होगा।
नोट यह एक हैक है जो इसे संकलित करने के लिए मिल जाएगा लेकिन स्क्रीन grabs सभी काले हो जाएगा। किसी को अद्यतित विधियों के साथ screengrab.c को फिर से लिखने में कुछ मिनट बिताने की जरूरत है।

3

जब मैं

#include <OpenGL/gl.h> 

यह संकलन नहीं था जोड़ा।

तो, मैं हालांकि मेरे हार्ड डिस्क एक दृष्टि डाली, प्रत्येक gl.h

की तलाश में तो, मैं

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

की कोशिश की तो मैं :-)

संबंधित मुद्दे