On 29 Jul 2012, at 11:05 AM, praveen krishna <praveenchitne...@gmail.com> wrote: > Oh,I haven't done this is this the mistake I have done? but is this > applicable for web2py as well .If so we have run this command in web2py > terminal?
No, it has nothing in particular to do with web2py. It's a Python thing. Some modules are written in C (for speed) and must be compiled for the architecture they're running on. You can read more about it here: http://docs.python.org/extending/extending.html > On Sun, Jul 29, 2012 at 7:59 PM, Jonathan Lundell <jlund...@pobox.com> wrote: > On 29 Jul 2012, at 10:56 AM, praveen krishna <praveenchitne...@gmail.com> > wrote: >> What do u mean by building a module.I don't know how to built a module I >> just extracted the folder and stored it in applications/yourapp/modules and >> tried to import it. > > Levenshtein is written in C, and must be compiled before it can be imported. > > python setup.py build > > should do the trick. You'll find the result (possibly named Levenshtein.so) > in the resulting build directory. Put that in site-packages/. > >> On Sun, Jul 29, 2012 at 7:52 PM, Jonathan Lundell <jlund...@pobox.com> wrote: >> On 29 Jul 2012, at 10:22 AM, praveen krishna <praveenchitne...@gmail.com> >> wrote: >>> How to import the Levenshtein in controller of web2py actullaý I have >>> downloaded the tar.bz2 folder of levenstein from >>> http://code.google.com/p/pylevenshtein/ extracted in web2py/site-packages >>> and used the command import Levenshtein but it dosen't work and even I >>> tried by extracting in applications/yourapp/modules and used the command >>> func = local_import('func') but this also dosen't work I am getting the >>> error >> >> >> Did you build the module? >>> --