Error : No module named ESL
Forum » WikiPBX / Technical Support » Error : No module named ESL
Started by: shrenik patelshrenik patel
On: 1273568212|%e %b %Y, %H:%M %Z|agohover
Number of posts: 9
rss icon RSS: New posts
Summary:
Problem with ESL module. Not able to build with make pymod
Error : No module named ESL
shrenik patelshrenik patel 1273568212|%e %b %Y, %H:%M %Z|agohover

I have install freeswitch and wikipbx. But When I start web-server
#python manage.py runserver 0.0.0.0:8000

in browser I am getting this :

ViewDoesNotExist at /
Could not import wikipbx.wikipbxweb.views. Error was: No module named ESL

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I am also not able to build ESL module
Build ESL with Python

I changed directory to libs/esl directory under freeswitch source tree & try to run following command.
$ make pymod

but I got error

make MYLIB="../libesl.a" SOLINK="-shared -Xlinker -x" CFLAGS="-I/usr/src/freeswitch/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" CXXFLAGS="-I/usr/src/freeswitch/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable" CXX_CFLAGS="" -C python
make[1]: Entering directory ‘/usr/src/freeswitch/libs/esl/python’
make[1]: Nothing to be done for ‘all’.
make[1]: Leaving directory ‘/usr/src/freeswitch/libs/esl/python’

Please help!! what should I do?
I will be very much obliged if you can help me.

Thank you
regards

Reply  |  Options
Unfold Error : No module named ESL by shrenik patelshrenik patel, 1273568212|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
stas_shtinstas_shtin 1273568941|%e %b %Y, %H:%M %Z|agohover

As described in WSGI configuration docs, you should have in your apache config something like:

WSGIPythonPath /usr/src/wikipbx:/usr/src/django:/usr/src/freeswitch/libs/esl/python

The last part of that path contains ESL python bindings directory. I suppose you've missed this step. The message from compiler is not an error - it just tells that you've compiled that library.

Reply  |  Options
Unfold Re: Error : No module named ESL by stas_shtinstas_shtin, 1273568941|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
shrenik patelshrenik patel 1273570656|%e %b %Y, %H:%M %Z|agohover

Thank you for the reply.

But still same error

ViewDoesNotExist at /
Could not import wikipbx.wikipbxweb.views. Error was: No module named ESL

My django install in this /usr/local/lib/python2.6/dist-packages/ & freeswitch & wikipbx stored at /user/src

My file /etc/apache2/site-available/wikipbx
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WSGIPythonPath /usr/src/wikipbx:/usr/local/lib/python2.6/dist-packages/django:/usr/src/freeswitch/libs/esl/python

<VirtualHost *:80>
ServerAdmin webmaster@localhost
WSGIScriptAlias / /usr/src/wikipbx/wikipbx.wsgi
ServerName localhost
ErrorLog /var/log/apache2/wikipbx.localhost.log
CustomLog /var/log/apache2/wikipbx.localhost.log common
</VirtualHost>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Awaiting for your reply

Reply  |  Options
Unfold Re: Error : No module named ESL by shrenik patelshrenik patel, 1273570656|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
stas_shtinstas_shtin 1273576313|%e %b %Y, %H:%M %Z|agohover

1. Is python2.6 the default version installed on your OS? What does this command return:

python --version

2. Make sure ESL library is built:

ls /usr/src/freeswitch/libs/esl/python/_ESL.so

Looks like that's the case, but an extra check won't hurt.

3. Run python with PYTHONPATH environment variable used for wikipbx:

PYTHONPATH=/usr/src/wikipbx:/usr/local/lib/python2.6/dist-packages/django:/usr/src/freeswitch/libs/esl/python python2.6

Execute this command:

import ESL

Do you get any errors?

Reply  |  Options
Unfold Re: Error : No module named ESL by stas_shtinstas_shtin, 1273576313|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
shrenik patelshrenik patel 1273587023|%e %b %Y, %H:%M %Z|agohover

Thanks for the reply.

I followed the steps. I didn't get any error. My python version is 2.6.
I copied libs/esl/python/ESL.py & _ESL.so to /usr/local/lib/python2.6/dist-packages/ and error is solved.
have I done any mistake with that ? is it correct ?

Reply  |  Options
Unfold Re: Error : No module named ESL by shrenik patelshrenik patel, 1273587023|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
stas_shtinstas_shtin 1273595140|%e %b %Y, %H:%M %Z|agohover

No, that's fine. The only problem you can have from this is if someday freeswitch will change event socket protocol to something incompatible with current version and you update freeswitch but don't copy ESL libs from the new version. But I think that it's a very unlikely situation.

Which version of mod_wsgi do you run? It looks like there's some change with its configuration directives, otherwise I don't understand why WSGIPythonPath didn't work.

Reply  |  Options
Unfold Re: Error : No module named ESL by stas_shtinstas_shtin, 1273595140|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
shrenik patelshrenik patel 1273604514|%e %b %Y, %H:%M %Z|agohover

My mod_wsgi (libapache2-mod-wsgi) version is 2.3. I have install through synaptic package manager in ubuntu 9.04.

Last edited on 1273604821|%e %b %Y, %H:%M %Z|agohover By shrenik patel + Show more
Reply  |  Options
Unfold Re: Error : No module named ESL by shrenik patelshrenik patel, 1273604514|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
tleydentleyden 1273617877|%e %b %Y, %H:%M %Z|agohover

I've seen cases where WSGIPythonPath seemed to be ignored and I had to manually add to sys.path in the .wsgi script. Unfortunately I didn't write down the exact mod_wsgi / python versions.

Reply  |  Options
Unfold Re: Error : No module named ESL by tleydentleyden, 1273617877|%e %b %Y, %H:%M %Z|agohover
Re: Error : No module named ESL
stas_shtinstas_shtin 1273656811|%e %b %Y, %H:%M %Z|agohover

According to mod_wsgi docs, starting from v2.0 it doesn't work it daemon mode. But there's parameter for daemon mode directive that lets you set python path instead.

Reply  |  Options
Unfold Re: Error : No module named ESL by stas_shtinstas_shtin, 1273656811|%e %b %Y, %H:%M %Z|agohover
New Post
page_revision: 0, last_edited: 1226259295|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License