Massimo, This has happened to me a few times it seems that an error in the module just proclaims it is not there instead of raising the error through the custom_import. I have not tried to fix it in web2py because I am under deadlines, I just know that there is a import error or something like that in the module and fix the module then all is good.
Andy On Saturday, October 20, 2012 7:43:43 AM UTC-7, Massimo Di Pierro wrote: > > I am very puzzled but this. It should not be necessary. Does the code > below work for you? > > $ python web2py.py -S welcome > (InteractiveConsole) > >>> import simplejson > > Do you have a module called simplejson in yourapp/modules/? > > From a normal python shell, shat happens if you do? > > >>> import simplejson > > On Thursday, 18 October 2012 14:17:38 UTC-5, Luciano Laporta Podazza wrote: >> >> Well it seems that after a lot of research and specially after posting >> this question that I found the solution. >> >> I've tried facebook-sdk module and had to modify just one line to make it >> work: >> >> facebook.py, line 49: >> # Find a JSON parser >> try: >> import simplejson as json >> >> >> To >> >> # Find a JSON parser >> try: >> import gluon.contrib.simplejson as json >> >> And that's all. Hope it helps anybody! >> >> On Thursday, October 18, 2012 1:43:29 PM UTC-3, Luciano Laporta Podazza >> wrote: >>> >>> Hello, first of all thank you Massimo and you people for this awesome >>> framework! I'm in love with it! :D >>> >>> I've tried to load some facebook modules and none of them works, at >>> least on Mac OS. >>> >>> This is what I did: >>> >>> 1. Get facebook api from one of these repos: >>> https://github.com/sciyoshi/pyfacebook/ >>> https://github.com/jgorset/facepy >>> https://github.com/pythonforfacebook/facebook-sdk >>> >>> 2. Copy them on "modules/" like this: >>> modules/facebook-api-folder/files.py >>> >>> 3. Load it from the controller, e.g. facepy module: >>> def index(): >>> from facepy import graph_api >>> >>> It doesn't matter what I try, I always get some errors: >>> - <type 'exceptions.ImportError'> No module named facepy (or other >>> module's name) >>> - With facebook-sdk it says that simplejson can't be loaded 'cause it >>> doesn't exists(and it exists and works!) >>> - it doesn't matter the way I put the module folder under modules/, for >>> example modules/facebookmodule/sub-dir/module.py and then from >>> facebookmodule.subdir import module. I always get the error that the module >>> does not exists. >>> - I even tried copying the module under site-packages and it seems to >>> load the module(I get no errors about it) but then I get the error that >>> simplejson doesn't exists(and this is not true). >>> >>> A friend of mine tried this on GNU/Linux and modules works perfectly, so >>> it seems the issue is related with Mac OS. >>> >>> Any ideas?. please note that I'm a newbie with python and web2py. >>> >>> LOT of thanks in advance :) >>> >> -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

