Nicholas, I'm sorry but this is not what Massimo asked for. You need to run these commands from inside web2py, after you've run it with:
python web2py.py -S welcome and not from a pure python shell. Also, how do you normally run web2py? Launching web2py.exe ? Cheers, Nico 2013/2/6 Nicholas Duffy <duffy.nicho...@gmail.com> > C:\Console2>python > Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] > on win > 32 > Type "help", "copyright", "credits" or "license" for more information. > > >>> import ldap > >>> import ldap.filter > >>> import sys > >>> print sys.path > ['', 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg', > 'C:\\Pytho > n27\\lib\\site-packages\\pip-1.2.1-py2.7.egg', > 'C:\\Windows\\system32\\python27. > zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', > 'C:\\Python27\\lib\\plat-win', > 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', > 'C:\\Python27\\lib\\site-packages', > 'C:\\Users\\nick.duffy\\Dropbox\\Work\\Apollo\\MINDBODYAPI\\mbapi', > 'C:\\Python > 27\\lib\\site-packages\\win32', > 'C:\\Python27\\lib\\site-packages\\win32\\lib', > 'C:\\Python27\\lib\\site-packages\\Pythonwin'] > > >>> > > On Tuesday, February 5, 2013 3:28:03 PM UTC-7, Massimo Di Pierro wrote: >> >> No idea. Whan you try open the web2py shell and try a manual import >> >> python web2py.py -S welcome >> >>> import ldap >> >>> import ldap.filter >> >>> import sys >> >>> print sys.path >> >> On Tuesday, 5 February 2013 16:20:05 UTC-6, Nicholas Duffy wrote: >>> >>> Thanks for the reply Massimo. >>> >>> Do you mean the web2py source? Because that is what I am using. I am >>> able to import other packages that I've installed via binary in >>> lib\site-packages like pyodbc and suds. I cannot seem to import ldap, >>> though. >>> >>> On Tuesday, February 5, 2013 7:36:58 AM UTC-7, Massimo Di Pierro wrote: >>>> >>>> Since you are using the windows binary, it comes with its own python >>>> and it does not see packages you installed on you "other" python. >>>> >>>> Your best option is use the web2py source distribution. It will see >>>> packages you install. >>>> >>>> On Monday, 4 February 2013 17:09:13 UTC-6, Nicholas Duffy wrote: >>>>> >>>>> Hello all, >>>>> -I have downloaded and installed python-ldap 2.4.10 from here: >>>>> http://pypi.python.org/pypi/**python-ldap/2.4.10<http://pypi.python.org/pypi/python-ldap/2.4.10> >>>>> --Windows binary 2.4.10 for Python 2.7 >>>>> --I get no errors when trying to import in the shell, so it's >>>>> installed. >>>>> -I have followed the directions here to attempt to setup >>>>> authentication with MS Active Directory: http://web2py.com/books/** >>>>> default/chapter/29/09 <http://web2py.com/books/default/chapter/29/09> >>>>> >>>>> However, immediately upon running my application, I receive this error: >>>>> ImportError: Cannot import module 'ldap' >>>>> File "C:\Python27\Lib\threading.py"**, line 524, in __bootstrap >>>>> self.__bootstrap_inner() >>>>> File "C:\Python27\Lib\threading.py"**, line 551, in __bootstrap_inner >>>>> self.run() >>>>> File "c:\web2py\gluon\rocket.py", line 1337, in run >>>>> self.run_app(conn) >>>>> File "c:\web2py\gluon\rocket.py", line 1838, in run_app >>>>> output = self.app(environ, self.start_response) >>>>> File "c:\web2py\gluon\main.py", line 725, in app_with_logging >>>>> ret[0] = wsgiapp(environ, responder2) >>>>> File "c:\web2py\gluon\main.py", line 543, in wsgibase >>>>> serve_controller(request, response, session) >>>>> File "c:\web2py\gluon\main.py", line 221, in serve_controller >>>>> run_models_in(environment) >>>>> File "c:\web2py\gluon\compileapp.**py", line 539, in run_models_in >>>>> restricted(code, environment, layer=model) >>>>> File "c:\web2py\gluon\restricted.**py", line 223, in restricted >>>>> sys.excepthook(etype, evalue, tb) >>>>> File "c:\web2py\applications\**apollo\models\db.py", line 44, in >>>>> <module> >>>>> from gluon.contrib.login_methods.**ldap_auth import ldap_auth >>>>> File "c:\web2py\gluon\custom_**import.py", line 96, in custom_importer >>>>> return NATIVE_IMPORTER(name, globals, locals, fromlist, level) >>>>> File "c:\web2py\gluon\contrib\**login_methods\ldap_auth.py", line 14, >>>>> in <module> >>>>> raise e >>>>> >>>>> What simple step am I missing? Thanks. >>>>> >>>>> >>>>> -- > > --- > 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/groups/opt_out. > > > -- --- 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/groups/opt_out.