7

I'm trying to install gevent-websocket for Python (http://www.gelens.org/code/gevent-websocket/), but when I run easy_install gevent-websocket I get "command 'gcc' failed with exit status 1".

The following is the full output from the terminal.

tgarv@tommy-Studio-1537:~/Desktop/Code$ sudo easy_install gevent-websocket
install_dir /usr/local/lib/python2.6/dist-packages/
Searching for gevent-websocket
Best match: gevent-websocket 0.3.4
Processing gevent_websocket-0.3.4-py2.6.egg
gevent-websocket 0.3.4 is already the active version in easy-install.pth

Using /usr/local/lib/python2.6/dist-packages/gevent_websocket-0.3.4-py2.6.egg
Processing dependencies for gevent-websocket
Searching for gevent
Reading http://pypi.python.org/simple/gevent/
Reading http://www.gevent.org/
Reading http://gevent.org/
Best match: gevent 0.13.6
Downloading http://pypi.python.org/packages/source/g/gevent/gevent-0.13.6.tar.gz#md5=7c836ce2315d44ba0af6134efbcd38c9
Processing gevent-0.13.6.tar.gz
Running gevent-0.13.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-zChaNp/gevent-0.13.6/egg-dist-tmp-cPxcYh
In file included from gevent/core.c:225:
gevent/libevent.h:9: fatal error: event.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
tgarv@tommy-Studio-1537:~/Desktop/Code$ 

I also get the same error when trying pip install, so I'm a bit clueless about what to do next. The output says "gevent-websocket 0.3.4 is already the active version in easy-install.pth" and I'm not sure what this means, but I do know that if I try to import gevent or geventwebsocket, it says the module doesn't exist.

tgarvz
  • 113
  • 1
  • 5

3 Answers3

14
gevent/libevent.h:9: fatal error: event.h: No such file or directory

Install the libevent development package for your distro.

Under Ubuntu, it's libevent-dev.

satoru
  • 31,822
  • 31
  • 91
  • 141
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
5

If you are on Ubuntu type the following:

 sudo apt-get install libevent-dev
 pip install gevent
0

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

Step - 1 Go to this website page and look for gevent.whl file according to your python version and download it.

Step - 2 In command prompt, Change directory to downloaded gevent.whl file,and copy under format.. C:\Users\ACER\Download>pip install .\gevent.whl

Step - 3 In python shell, Try it out like "import gevent".. I think it will work! Be successful...