Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: 'event.h' file not found while installing in virtualenv on OSX 10.8.3 #77

Closed
askrht opened this issue May 28, 2013 · 8 comments

Comments

@askrht
Copy link

askrht commented May 28, 2013

I am using a virtualenv on osx 10.8.3. I am unable to install locust.
python setup.py install # breaks down
Can you please help me install it in a virtualenv? Detailed error copied below:

Installed /Users/zzz/dev/skc/lib/python2.7/site-packages/Flask-0.9-py2.7.egg
Searching for gevent>=0.13
Reading http://pypi.python.org/simple/gevent/
Reading http://www.gevent.org/
Reading http://gevent.org/
Best match: gevent 0.13.8
Downloading http://pypi.python.org/packages/source/g/gevent/gevent-0.13.8.tar.gz#md5=ca9dcaa7880762d8ebbc266b11252960
Processing gevent-0.13.8.tar.gz
Running gevent-0.13.8/setup.py -q bdist_egg --dist-dir /var/folders/t8/szvbsng97ps56j30w_xl692r0000gn/T/easy_install-3ZM8dE/gevent-0.13.8/egg-dist-tmp-MYFzQ_
clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from gevent/core.c:253:
gevent/libevent.h:9:10: fatal error: 'event.h' file not found

include "event.h"

     ^

1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1

@askrht
Copy link
Author

askrht commented May 28, 2013

SOLUTION:

sudo port install libevent
CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent

Courtesy Dietrich Epp at http://stackoverflow.com/questions/7630388/how-can-i-install-the-python-library-gevent-on-mac-os-x-lion

@askrht askrht closed this as completed May 28, 2013
@scharf
Copy link

scharf commented Jun 18, 2013

or if you have http://mxcl.github.io/homebrew/ installed do:
brew install libevent

@ssbarnea
Copy link

Please reopen this ticket. I understand that there is an workaround but that does not make the bug invalid, people should be able to install the package without additional work.

If it is not currently possible to include the dependency in the package at least the setup code should be able to detect this and provide the commands for installing it, maybe even trying to run them.

Here is the logic: if platform=='darwin' and event.h is missing, run 'brew install libevent' or die with explanatory message, maybe even link to to this issue.

@askrht
Copy link
Author

askrht commented Jul 10, 2013

Agree, a workaround is not a complete solution. Either the install script needs to be enhanced or we need to document the extra steps.

@askrht askrht reopened this Jul 10, 2013
@cgbystrom
Copy link
Member

Here is the logic: if platform=='darwin' and event.h is missing, run 'brew install libevent' or die with explanatory message, maybe even link to to this issue.

@ssbarnea Doing platform specific actions for missing dependencies is tricky. Having the install script execute Homebrew is just one way to do it on Mac. It may or may not be the preferred way for the current user.

The best thing we can do is to properly document what the requirements are and how to install any dependencies.
If you feel the documentation is lacking in this area, please submit a pull request with improvements.

@ssbarnea
Copy link

Personally I would vote for running brew directly and failing with the verbose message if this fails. Brew became the defacto way of installing stuff on Mac few years ago, replacing macports and fink. I used all of them over time.

In addition brew has the huge advantage of working without requiring you to sudo.

@heyman
Copy link
Member

heyman commented Jul 10, 2013

I also think brew is the best package manager for OSX. However, everyone might not agree, and I would find it extremely obtrusive if a python package's setup file would start brew installing stuff for me. Also, I don't know of any other python packages that does this.

+1 on better documentation of the dependencies, and how to install them on different platforms.

@Jahaja
Copy link
Member

Jahaja commented Jul 13, 2013

Closing this issue as I think we agree that this is not a binary distribution, so one will have to prepare one's system to be able to build the dependencies.

@Jahaja Jahaja closed this as completed Jul 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants