You will need to get XCode from Apple’s App Store and make sure to install the
Command Line Tools. You do this under Preferences>Downloads (Using XCode 5 you don’t have to do that anymore, apparently).
virtualenv can be done using
pip if available):
$ easy_install virtualenv
Here’s how you can use virtualenv:
$ mkdir MyExample $ cd MyExample $ virtualenv ENV $ source ENV/bin/activate (ENV)$
The virtualenv package comes with
pip, so we’ll use this instead of easy_install.
We need to install the C-library libevent. Download the latest version and do the following while in the virtual environment:
(ENV)$ curl -L -O https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz (ENV)$ tar xzf libevent-2.0.21-stable.tar.gz (ENV)$ cd libevent-2.0.21-stable (ENV)$ ./configure --prefix="$VIRTUAL_ENV" (ENV)$ make && make install (ENV)$ cd $VIRTUAL_ENV/..
If all went well, install the Pyton packages
gevent. Note that the order is important.
(ENV)$ pip install greenlet (ENV)$ pip install gevent --global-option "-L$VIRTUAL_ENV/lib" \ --global-option "-I$VIRTUAL_ENV/include"
The order is important because gevent depends on greenlet. If you install gevent first, the extra global options will not work and you’ll get an error.
Try to import
gevent and if all went well, no error should raise:
$ python >>> import gevent
Using OSX ‘Mavericks’ v10.9-beta you need XCode v5 Developer Preview to be able to compile
If you like to leave a comment, but don't like to use Disqus, please send an email instead. Comments by email might end up as a FAQ here under.