2015-09-05 17 views
39

Cercando di installare gevent utilizzando Homebrew su OSX 10.11 ultima beta pubblica. Quando si esegue l'installazione, emette i seguenti errori (scusate la grande parete di codice, non so esattamente dove l'errore è)Impossibile installare gevent OSX 10.11

clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I /opt/local/include -L /opt/local/lib -U__llvm__ -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.macosx-10.11-x86_64-2.7/libev -Ilibev -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/gevent.core.c -o build/temp.macosx-10.11-x86_64-2.7/gevent/gevent.core.o 
    clang: warning: argument unused during compilation: '-L/opt/local/lib' 
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    libev/ev.c:483:48: warning: '/*' within block comment [-Wcomment] 
    /*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */ 
               ^
    libev/ev.c:1029:42: error: '_Noreturn' keyword must precede function declarator 
    ecb_inline void ecb_unreachable (void) ecb_noreturn; 
              ^~~~~~~~~~~~ 
    _Noreturn 
    libev/ev.c:832:26: note: expanded from macro 'ecb_noreturn' 
    #define ecb_noreturn _Noreturn 
         ^
    libev/ev.c:1625:31: warning: 'extern' variable has an initializer [-Wextern-initializer] 
    EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ 
           ^
    libev/ev.c:1796:7: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ANPENDING, pendings [pri], pendingmax [pri], w_->pending, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:1807:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (W, rfeeds, rfeedmax, rfeedcnt + 1, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:1934:7: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (int, fdchanges, fdchangemax, fdchangecnt, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    In file included from libev/ev.c:2484: 
    libev/ev_kqueue.c:50:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    In file included from libev/ev.c:2490: 
    libev/ev_poll.c:66:7: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (struct pollfd, polls, pollmax, pollcnt, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:3648:34: warning: '&' within '|' [-Wbitwise-op-parentheses] 
    fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); 
         ~~~~~~~~~~^~~~~~~~~~~~~ ~ 
    libev/ev.c:3648:34: note: place parentheses around the '&' expression to silence this warning 
    fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); 
           ^
         (     ) 
    libev/ev.c:3687:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (ANHE, timers, timermax, ev_active (w) + 1, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:4367:5: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_idle *, idles [ABSPRI (w)], idlemax [ABSPRI (w)], active, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:4407:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (ev_prepare *, prepares, preparemax, preparecnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:4445:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (ev_check *, checks, checkmax, checkcnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:4592:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (ev_fork *, forks, forkmax, forkcnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    libev/ev.c:4675:3: warning: unused variable 'ocur_' [-Wunused-variable] 
    array_needsize (ev_async *, asyncs, asyncmax, asynccnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
     int ecb_unused ocur_ = (cur);          \ 
        ^
    14 warnings and 1 error generated. 
    error: command 'clang' failed with exit status 1 

    ---------------------------------------- 
    Failed building wheel for gevent 
Failed to build gevent 
Installing collected packages: gevent 
    Running setup.py install for gevent 
    Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/q8/1c24n_wj6kzc6kgl7629pwyh0000gn/T/pip-build-3zCPVx/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/q8/1c24n_wj6kzc6kgl7629pwyh0000gn/T/pip-9VpZCX-record/install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_py 
    running build_ext 
    building 'gevent.core' extension 
    clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I /opt/local/include -L /opt/local/lib -U__llvm__ -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.macosx-10.11-x86_64-2.7/libev -Ilibev -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/gevent.core.c -o build/temp.macosx-10.11-x86_64-2.7/gevent/gevent.core.o 
    clang: warning: argument unused during compilation: '-L/opt/local/lib' 
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    libev/ev.c:483:48: warning: '/*' within block comment [-Wcomment] 
    /*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */ 
               ^
    libev/ev.c:1029:42: error: '_Noreturn' keyword must precede function declarator 
     ecb_inline void ecb_unreachable (void) ecb_noreturn; 
              ^~~~~~~~~~~~ 
     _Noreturn 
    libev/ev.c:832:26: note: expanded from macro 'ecb_noreturn' 
     #define ecb_noreturn _Noreturn 
          ^
    libev/ev.c:1625:31: warning: 'extern' variable has an initializer [-Wextern-initializer] 
     EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ 
           ^
    libev/ev.c:1796:7: warning: unused variable 'ocur_' [-Wunused-variable] 
      array_needsize (ANPENDING, pendings [pri], pendingmax [pri], w_->pending, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:1807:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (W, rfeeds, rfeedmax, rfeedcnt + 1, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:1934:7: warning: unused variable 'ocur_' [-Wunused-variable] 
      array_needsize (int, fdchanges, fdchangemax, fdchangecnt, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    In file included from libev/ev.c:2484: 
    libev/ev_kqueue.c:50:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    In file included from gevent/gevent.core.c:249: 
    In file included from gevent/libev.h:2: 
    In file included from libev/ev.c:2490: 
    libev/ev_poll.c:66:7: warning: unused variable 'ocur_' [-Wunused-variable] 
      array_needsize (struct pollfd, polls, pollmax, pollcnt, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:3648:34: warning: '&' within '|' [-Wbitwise-op-parentheses] 
     fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); 
          ~~~~~~~~~~^~~~~~~~~~~~~ ~ 
    libev/ev.c:3648:34: note: place parentheses around the '&' expression to silence this warning 
     fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); 
            ^
          (     ) 
    libev/ev.c:3687:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ANHE, timers, timermax, ev_active (w) + 1, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:4367:5: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_idle *, idles [ABSPRI (w)], idlemax [ABSPRI (w)], active, EMPTY2); 
     ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:4407:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_prepare *, prepares, preparemax, preparecnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:4445:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_check *, checks, checkmax, checkcnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:4592:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_fork *, forks, forkmax, forkcnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    libev/ev.c:4675:3: warning: unused variable 'ocur_' [-Wunused-variable] 
     array_needsize (ev_async *, asyncs, asyncmax, asynccnt, EMPTY2); 
    ^
    libev/ev.c:1758:22: note: expanded from macro 'array_needsize' 
      int ecb_unused ocur_ = (cur);          \ 
         ^
    14 warnings and 1 error generated. 
    error: command 'clang' failed with exit status 1 

    ---------------------------------------- 
Command "/usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/q8/1c24n_wj6kzc6kgl7629pwyh0000gn/T/pip-build-3zCPVx/gevent/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/q8/1c24n_wj6kzc6kgl7629pwyh0000gn/T/pip-9VpZCX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/q8/1c24n_wj6kzc6kgl7629pwyh0000gn/T/pip-build-3zCPVx/gevent 

risposta

93

uso CFLAGS='-std=c99' pip install gevent per risolvere questo problema.

su OS X 10.11, clang utilizza c11 come valore predefinito, quindi è sufficiente tornare al c99.

+4

Ho 10.10.5, non ho potuto installare gevent e questo ha risolto il mio problema. – red

+1

good lord questo mi stava facendo impazzire su OSX 10.10.5, lo stesso problema, e l'impostazione di CFLAGS come root e l'installazione di 'gevent' ha fatto il trucco-- grazie! – Wells

+0

Questo ha funzionato anche per me. Il loro script di installazione dovrebbe gestire questo ... – ysakamoto

12

Ho incontrato lo stesso problema sul mio OSX 10.10.5, si tenta di installare flask-socketio, che ha gevent come una dipendenza, ma:

sudo CFLAGS='-std=c99' pip install flask-socketio 

mi ha dato

Successfully installed flask-socketio-0.6.0 gevent-1.0.2 gevent-socketio-0.3.6 gevent-websocket-0.9.5 

Quindi, tonicbupt di la risposta ha funzionato anche per questo.

+0

Il 10.11 e ho dovuto usare 'sudo CFLAGS = '- std = c99' pip installa flask-socketio --no-use-wheel' per farlo funzionare. –

5

ho sprecato il mio tempo per due giorni e la soluzione qui di seguito per gli utenti Mac ...

pip install gevent==1.1b5 

Soluzione: gevent fails to install in a python virtual environment on OS X Capitan

+0

Sebbene questo collegamento possa rispondere alla domanda, è meglio includere qui le parti essenziali della risposta e fornire il link per riferimento. Le risposte di solo collegamento possono diventare non valide se la pagina collegata cambia. - [Dalla recensione] (/ recensione/post di bassa qualità/10647395) – fasteque

+1

Grazie per il tuo commento. Solo 'pip install gevent == 1.1b5' ha risolto il mio problema. Non penso che sia una risposta "solo link". –

3

Su Mac OS X El Capitan, ho dovuto fare entrambe le cose che sono stati menzionati nelle risposte precedenti, impostare la variabile CFLAGS e downgrade di gevent, ma ho dovuto usare la versione 1.0 per cancellare gli errori del compilatore.

CFLAGS='-std=c99' pip install gevent==1.0 
+1

1.0.2 è OK su el Capitan, con CFLAGS come sopra, ma il compilatore C produce un bel po 'di warings – tgdavies

1

Come descritto nella sua PyPI instruction,

pip install --pre gevent

dovrebbe installare una versione release candidate (1.1rc4 come di Feb 22, 2016), che lavora per OS X 10.11.

0

In questo momento, gevent 1.1.0 final viene rilasciato sotto forma di una ruota binaria per OS X e pip lo installerà di default. Una ruota binaria per gevent 1.0.2 per OS X è disponibile anche per coloro che non possono eseguire l'aggiornamento alla versione più recente. Entrambi sono stati testati per l'installazione su OS X 10.11 con Python 2.6 e 2.7 distribuiti da Apple, oltre al 2.7 Python scaricato da python.org. (Se hai problemi nell'installare le ruote binarie, potrebbe essere necessario aggiornare la tua versione di pip.)

Quindi non ci dovrebbe essere alcuna necessità di impostare alcun CFLAGS speciale a meno che non sia necessario compilare 1.0.2 dalla sorgente. (1.1.0 non soffre di questo problema.)

Si noti che le ruote sono distribuite per le build unicode "strette" di Python, quindi se si utilizza una build "ampia", è necessario compilare da fonte. In questo caso, l'impostazione di CFLAGS = "- std = c99" è richiesta per gevent 1.0.2 (ma non 1.1.0.)

Problemi correlati