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 :)
>>
>

-- 



Reply via email to