Ubuntu 12.04.2 install: missing event.h and fails unless installed to /usr/plivo

1,414 views
Skip to first unread message

Matt Williams

unread,
Aug 14, 2013, 10:57:31 AM8/14/13
to plivo...@googlegroups.com
Hi,
 
I've previously installed FreeSWITCH and Plivo successfully on Ubuntu 12.04.2 using the instructions at http://docs.plivo.org/get-started/.  However, I tried following these instructions again a few days ago and hit 2 problems.  I suspect that some Ubuntu packages or Python eggs have been updated and this has caused the problems to be exposed.
 
 
1) Missing event.h
 
The first problem is that the install fails due to gevent failing to build because event.h is missing.
 
Installing collected packages: gevent, greenlet
  Running setup.py install for gevent
    building 'gevent.core' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-x86_64-2.7/gevent/core.o
    In file included from gevent/core.c:253:0:
    gevent/libevent.h:9:19: fatal error: event.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
 
event.h is part of libevent-dev, so installing this with "apt-get install libevent-dev" or adding it to the list of packages at plivo_install.sh;81 fixes this.
 
 
2) Install to /usr/local/plivo fails
 
After fixing this, I still see the following error.
 
Installing collected packages: plivo, flask, ujson, redis, Werkzeug, Jinja2, markupsafe
  Running setup.py develop for plivo
    error: None
    Complete output from command /usr/local/plivo/bin/python -c "import setuptools; __file__='/usr/local/plivo/src/plivo/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps:
    running develop
 
error: None
 
Running "DISTUTILS_DEBUG=1 /usr/local/plivo/bin/python -c "import setuptools; __file__='/usr/local/plivo/src/plivo/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps" gives more information on the failure.
 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/plivo/src/plivo/setup.py", line 71, in <module>
    setup(**setup_args)
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "/usr/local/plivo/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 51, in finalize_options
    easy_install.finalize_options(self)
  File "/usr/local/plivo/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 227, in finalize_options
    prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix')
  File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 344, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/plivo/lib/python2.7/config/Makefile (No such file or directory)
 
For some reason, sysconfig.py is deciding to strip the "local" from /usr/local/plivo and so is looking for the Makefile in the wrong place.  (Looking at the code, it does this explicitly, but there's no comment as to why.)  This behavior seems to have changed/been fixed in later versions of Python.  I worked around it by first installing to /usr/plivo (with "bash plivo_install.sh /usr/plivo") and then reinstalling to /usr/local/plivo (with "bash plivo_install.sh /usr/local/plivo") - very hacky, but it seems to work.  I'm not sure what the "right" fix is here, apart from upgrading Python (although Ubuntu 12.04.2 doesn't come with a more recent version).
 
 
Has anyone else seen these issues, do you agree they're worth fixing and, if so, does anyone know how I raise them?
 
Any help/advice you can give would be much appreciated.
 
Thanks,
 
Matt
 

David | StyleFlare

unread,
Aug 14, 2013, 11:17:13 AM8/14/13
to plivo...@googlegroups.com
Was this over a previous installation or new?
--
You received this message because you are subscribed to the Google Groups "Plivo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plivo-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexander Polyakov

unread,
Aug 15, 2013, 1:24:34 AM8/15/13
to plivo...@googlegroups.com
Hello Matt,

I had the same problem installing Plivo on Ubuntu 12.04.2 this last weekend. Resolved the problem in the same dirty way that you did.

Matt Williams

unread,
Aug 15, 2013, 10:55:44 AM8/15/13
to plivo...@googlegroups.com
David, this was a new installation.  Vanilla Ubuntu 12.04.2 EC2 instance, then following the instructions linked to above.

Alexander
, I'm glad I'm not the only one. ;)

Thanks,

Matt

Jayesh Labade

unread,
Aug 23, 2013, 2:09:23 AM8/23/13
to plivo...@googlegroups.com
Any update for this issue. I am also facing same problem here

Best Regards,
Jayesh Labade

devel...@socialnicheguru.com

unread,
Feb 18, 2014, 10:31:13 AM2/18/14
to plivo...@googlegroups.com
Thanks for this. What a random error. 
The hack worked.

Dev @ SocialNicheGuru.com

sudhanshu srivastav

unread,
Feb 6, 2017, 8:54:54 AM2/6/17
to Plivo Opensource Users
what was solution >?
Reply all
Reply to author
Forward
0 new messages