How can I install the Python library 'gevent' on Mac OS X Lion

前端 未结 10 640
灰色年华
灰色年华 2020-12-22 19:03

Python library gevent, version 0.13.6 (the current version on PyPI) will not pip install on OS X Lion, Python 2.7 (and probably others.) It works f

相关标签:
10条回答
  • 2020-12-22 19:37

    After a while, I realized that the paths for the CFLAGS variable mentioned above works when installing libevent from port, but not from brew. The following worked for me (on OSX Mavericks):

    $ brew install libevent
    $ export CFLAGS="-I /usr/local/Cellar/libevent/2.0.21/include -L /usr/local/Cellar/libevent/2.0.21/lib"
    $ pip install gevent
    
    0 讨论(0)
  • 2020-12-22 19:37

    This is the way I found the easiest:

    install libevent using homebrew

    $ brew install libevent
    

    install gevent

    $ pip install gevent
    

    This was the only way I could get it to work.

    0 讨论(0)
  • 2020-12-22 19:37
    sudo pip install cython git+git://github.com/gevent/gevent.git#egg=gevent
    
    0 讨论(0)
  • 2020-12-22 19:51

    I had libevent installed via brew and it failed too, what worked was similar to what Stephen done, but pointing to brew default install:

    CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib pip install gevent

    0 讨论(0)
  • 2020-12-22 19:54

    I use virtualenv and virtualenv wrapper, and so I wanted this to be self contained. I got gevent working like so:

    Assuming you have virtual env setup, then:

    workon {my_virtual_env}
    

    Then download libevent and install it against the virtualenv.

    curl -L -O https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    
    tar -xzf libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    ./configure --prefix="$VIRTUAL_ENV"
    make && make install
    

    I'm assuming you've got gcc 5+ installed (I use brew)

    Hope this helps.

    0 讨论(0)
  • 2020-12-22 19:54

    I am using MacOs High Sierra (10.13.3) First I did : brew install libevent

    I upgraded my pip version to pip-18.0. then tried installing again with following :-

    pip install gevent
    

    it worked.

    0 讨论(0)
提交回复
热议问题