I understand that but that is not the problem. 

When you say import ldap, web2py tries to import it from various location. 
When it fails to import from all locations, it reports the error you see 
and the error include the path to the first location it tried. That does 
not mean that it did not try the other locations.

So, please try the regular python shell (not the web2py shell) and type 
there

import ldap

Massimo


On Tuesday, 25 August 2015 00:56:41 UTC-5, Johann Spies wrote:
>
>
>
> On 24 August 2015 at 16:20, Massimo Di Pierro <massimo.dipie...@gmail.com> 
> wrote:
>
> So the problem is that it cannot import ldal. Do you know it works from 
>> the normal python shell?
>>
>> >>> import ldap
>>
>> Does it work from the web2py shell?
>>
>
>
> No, I cannot import ldap. I also tried it from another app (welcome) this 
> time:
>
>
> In [1]: import ldap
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> /home/js/web2py/applications/welcome/models/menu.py in <module>()
> ----> 1 import ldap
>
> /home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals, 
> locals, fromlist, level)
>      87                             result = result or 
> sys.modules[modules_prefix+'.'+itemname]
>      88                         except KeyError, e:
> ---> 89                             raise ImportError, 'Cannot import 
> module %s' % str(e)
>      90                         modules_prefix += "." + itemname
>      91                     return result
>
> ImportError: Cannot import module 'applications.welcome.modules.ldap'
>
> and the same with ldap_auth:
>
> import ldap_auth
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> /home/js/web2py/applications/welcome/models/menu.py in <module>()
> ----> 1 import ldap_auth
>
> /home/js/web2py/gluon/custom_import.pyc in custom_importer(name, globals, 
> locals, fromlist, level)
>      87                             result = result or 
> sys.modules[modules_prefix+'.'+itemname]
>      88                         except KeyError, e:
> ---> 89                             raise ImportError, 'Cannot import 
> module %s' % str(e)
>      90                         modules_prefix += "." + itemname
>      91                     return result
>
> ImportError: Cannot import module 'applications.welcome.modules.ldap_auth'
>
>
>
> Regards
> Johann
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to